Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stop software on w2k
Message
De
13/11/2002 08:10:48
 
 
À
13/11/2002 07:20:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00722030
Message ID:
00722038
Vues:
15
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform