Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How NT terminates processes ?
Message
From
06/06/2002 13:23:13
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00664618
Message ID:
00665585
Views:
21
>>my program brings the same list of processes with the same process id as NT. but the terminateprocess function i use doens't terminate them.
>>i would like to know how NT does this operation ?
>
>How are you using it? See Message#496824 for an example.

TerminateProcess() will definitely shut down a process if it can be killed at all, however, it's almost always preferable to send a WM_CLOSE to the thread's message queue using SendMessage() to send it to the hWnd of the primary Window for the process or PostThreadMessage() to send it to the main thread handle and give it a chance to do an orderly shutdown rather than using TerminateProcess() indiscriminantly, since while it kills the process space, it doesn't release shared DLL or COM resources properly, nor does it release remoted file handles when it quits - it depends on the remote server determining that the client has ceased to be.
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