>>>Hiya John,
>>>
>>>I may try this. Also, FP DOS app (it is really just .FXP) may be run from the batch file before the VFP Monitor app even starts, and I am not sure how to get process handle in this case. Didn't work much with API stuff before. :)
>>
>>Nick,
>>
>>Without the process handle it's a problem. You can only shutdown a DOS session via SendMessage() if the process has already terminated. See
"How do I close another application?". Of course, using a pif file to launch the program, can eliminate the need for this entirely.
>
>Hi George,
>
>So, the is no way to obtain the process handle knowing only hWND, is it? The VFP Monitor app can be shut down and restarted while the FoxPro DOS session is still running. I still can get it's hWND again after restarting the Monitor and use SendMessage(WM_DESTROY), but I would like to have more precise control on shutting down the server rather than rude WM_DESTROY. :)
Nick,
To the best of my knowledge, there's no way via a window handle to retrieve the handle to a specific process. I think that the only ways are to use either CreateProcess, or GetCurrentProcess.
George
Ubi caritas et amor, deus ibi est