kuijer
May 11th, 1999, 05:29 AM
Hi,
I want to open a file (type-independent), but there should be no more than one instance of the specified file. ie. when one uses ShellExecute( ....,"open", "notepad", ...., SW_SHOWNORMAL ); twice, there should be only one instance of notepad. (Notepad is not the real target program, but used as an example)
I figured that if i could get the window-title from a file name (like notepad.exe to "Untitled - Notepad") then i would be able to use FindWindow to check wether there's an instance running or not. Is this the right way, or should i do this otherwise? Any suggestions?
I want to open a file (type-independent), but there should be no more than one instance of the specified file. ie. when one uses ShellExecute( ....,"open", "notepad", ...., SW_SHOWNORMAL ); twice, there should be only one instance of notepad. (Notepad is not the real target program, but used as an example)
I figured that if i could get the window-title from a file name (like notepad.exe to "Untitled - Notepad") then i would be able to use FindWindow to check wether there's an instance running or not. Is this the right way, or should i do this otherwise? Any suggestions?