Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Kill a process
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00890217
Message ID:
00890808
Views:
28
>Guys , I'm still looking for the code to kill my process in win2k. so far all the codes I've been given don't work. and for some reason the links you all gave don'r work for me, they don't display.
>
>please help

Sorry about that, Selim, we got side-tracked. The cleanest way to kill a process, I believe, is to send it a WM_SYSCOMMAND, SC_CLOSE message, either via PostMessage or SendMessage API function. This requires that you have an HWND to the task's main window. Another flavor of message that usually works is WM_CLOSE. If you have a COM object reference, there may be a Quit method, or something similar. If you've only got a processid or process handle, you can generally use it to find the HWND. Terminating a process directly via TerminateProcess is usually the last resort, as it may leave things in an unclean state. See http://www.news2news.com/vfp/index.php for lots of helpful info about using Windows API functions from VFP, including examples.

Mike
Montage

"Free at last..."
Previous
Reply
Map
View

Click here to load this message in the networking platform