Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TerminateProcess()
Message
From
16/12/2003 10:51:55
 
 
To
16/12/2003 07:57:57
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00859248
Message ID:
00859501
Views:
24
Ah, I see from your reply to Nick that you do have a window handle. In this case you could use the 'soft' approach via PostMessage(m.hWnd, WM_QUIT, 0, 0) or PostThreadMessage() with the thread id obtained from the window handle.

If the app does not go away 'soon' after receiving the WM_QUIT then this is probably a sign that it is prompting the user in a modal fashion, in which case it would be a good idea to bring the app to front after telling the user about this. Of course, the user could still choose to terminate the app the hard way but that should only rarely be necessary.

You can use the process handle to check whether the app is still alive. Process handles change state to signalled when the process terminates, and the GetExitCodeProcess() function returns STILL_RUNNING if the process still exists.
Previous
Reply
Map
View

Click here to load this message in the networking platform