General information
Category:
Windows API functions
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only