Information générale
Catégorie:
Fonctions Windows API
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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement