>I need to be able to open a .tif file from my VFP application. My VFP app needs to wait until the user is done with the .tif file and then continue the execution. Currently i'm using ShellExecute which opens the file as it should, but it don't allow me to wait for close. How can I do that?
>
>I've searched microsoft.com and found the file runwait.exe which holds the source code for a library called runlib.dll, unfortanly I don't have Visual C++ to compile the program. Has anyone else looked at the program?
You can implement the ShellExecuteEx() API call; it returns a usable process ID in its structure if it does not use DDE to open the OLE Server for the file. I do noy have code that I'm willing to post to do this - it is implementable using ClsHeap to handle the memory allocation for the pointers needed by the structure used by ShellExecuteEx(). Alternatively, you can find the Window your TIFF is opened in, use the hWnd to retrieve the ProcessID using GetWindowThreadProcessId() and wait for the process to terminate by getting a handle to the process using OpenProcess() and use WaitOnSingleObject() for it to terminate.