>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