March 17th, 2004, 02:08 PM
Read FAQ but how to open assoc'd file and wait till done?
The FAQ "How can I start a process?" suggests using ShellExecute/Ex to open a document with its associated application...
And FAQ "How do I wait until a process ends?" suggests using WaitForSingleObject(hProcess, INF) from CreateProcess' piProcessInfo...
But, how can I wait for an arbitrary application to end? Is there a way to use CreateProcess w/o specifying an application?
Using ShellExecuteEx to get the process handle is, as has been said, risky because if, say, IE is already running, you won't get a valid handle for the existing process.
Click Here to Expand Forum to Full Width