Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TerminateProcess()
Message
De
16/12/2003 10:51:55
 
 
À
16/12/2003 07:57:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00859248
Message ID:
00859501
Vues:
26
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
Fil
Voir

Click here to load this message in the networking platform