Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close program from it fullpath ?
Message
From
26/11/2002 12:17:02
 
 
To
20/11/2002 05:40:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00724656
Message ID:
00727109
Views:
17
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform