Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Close particular program(.exe)
Message
 
 
À
26/11/2000 06:54:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00445134
Message ID:
00445505
Vues:
15
>Mike, I tend to use PostMessage() or PostThreadMessage() (depends on if I have an hWnd or a ThreadId) and a WM_QUIT rather than SendMessage() and a WM_CLOSE; it has the advantage that the message is added to the tail of the message queue, so pending events do get fired before the app shuts down.

Though I'll agree that PostMessage() is a better choice than SendMessage() in most circumstances, why WM_QUIT instead of WM_CLOSE? I ask because WM_QUIT seems to be more suitable for use with PostQuitMessage() (notice that wParam is the PostQuitMessage() exit code). My reasoning for WM_CLOSE is that it tells the app "hey, you need to shut down", and the app still has the chance to ask for user confirmation.
Mike Stewart
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform