>I have a two-part question. First, I have been able to use WaitForSingleObject in conjunction with CreateProcess to wait infinitely until my process finishes. Has anyone had any luck doing the same with ShellExecute? I know I could use FindWindow in loop, but I would like to use WaitForSingleObject.
>
Timothy,
I can't answer the second part of your question, but I'll take a shot at the first.
WaitForSingleObject() requires the handle to an object (semaphore, mutex, process, etc.). Now the Win32 documentation mentions that it will work will other handles, but it is a discouraged practice. Further, instance handles, such as are returned by ShellExecute(), are not mentioned in the list of other handles.
One suggestion: The declaration for ShellExecute() should indicate that the strings are passed by reference, not value. It may work, but (as I've discovered in working with Shell32) some functions will GPF VFP if not properly passed.
George
Ubi caritas et amor, deus ibi est