>ShellExecuteEx() does not guarentee that you will receive back a valid process ID since no new process is necessarily spawned if the OLE linkage for the file action is based on DDE and an existing instance of the application is running; the implementation is non-trivial. If a process handle is returned, you can terminate the process with it via TerminateProcess() or PostThreadMessage() once you get the ThreadID for the thread servicing the document, using a WM_CLOSE or WM_QUIT, but for a number of reasons you may not be able to accurately determine if processing the document has completed, especially if DDE linkage to an MDI app is involved. Extensive review of the MSDN Library documentation on ShellExecuteEx() is required to rely on using it properly.
Thanks for the heads up, Ed. I hadn't bothered to research it as thoroughly as perhaps I should have due to the required embedded pointers within the SHELLEXECUTEINFO structure. Didn't seem like it was a "good" candidate for a call from VFP.
George
Ubi caritas et amor, deus ibi est