Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Close particular program(.exe)
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00445134
Message ID:
00445505
Views:
10
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform