Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Close particular program(.exe)
Message
From
27/11/2000 19:09:40
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00445134
Message ID:
00445924
Views:
16
>>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.

Primarily tro force past the confirmation dialogs, but, yes, you can use a WM_CLOSE just as effectively. Just a matter of habit developed from years of sloppy coding.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform