Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stop software on w2k
Message
From
13/11/2002 08:10:48
 
 
To
13/11/2002 07:20:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00722030
Message ID:
00722038
Views:
14
>with W98 i use TerminateProcess to stop a program (word or excel) but on W2k the code doesn't work why ?

You need to get a handle to the process with the necessary permissions to terminate it; when you perform the OpenProcess() call to access the process to terminate, you need the PROCESS_TERMINATE or PROCESS_ALL_ACCESS permission to have been granted to then shut down the process using TerminateProcess(), a privilege not usually granted to normal user applications that did not spawn the other process. See the entry Process Security and Access Rights in the MSDN and the related articles on altering the security identifier for a process.

In general, it is not recommended to use TerminateProcess() to halt a running application unless the process has stopped responding to normal Windows messages.
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
Next
Reply
Map
View

Click here to load this message in the networking platform