Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close program from it fullpath ?
Message
De
26/11/2002 12:17:02
 
 
À
20/11/2002 05:40:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00724656
Message ID:
00727109
Vues:
18
>how to close a program from it fullpath on W2k or how to know the handle of a program by it fullpath ?

There is a download here on UT that uses the CreateToolhelp32Snapshot function which can record a snapshot of the processes running on the system; from this, you could find a process ID for the process that you wanted to shut down. You would then either enumerate the system windows and use GetWindowThreadProcessId to match a Window to the process ID obtained earlier, and send the Window a WM_CLOSE message, or use OpenProcess to return a handle to the process, requesting the PROCESS_TERMINATE privilege, and call TerminateProcess with the handle that you obtain.

IAC, a not insignificant amount of coding is involved to implement this.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform