Could you tell me how to kill a existing process from another program ?
-
Hi try TerminateProcess API function
BOOL TerminateProcess(HANDLE hProcess,UINT uExitCode)
-
You'll need the ToolHelp32 or PSAPI files depending on which OS you want to support. There are a variety of functions in those that allow you to list processes, terminate processes, etc.
-
You'll need the ToolHelp32 or PSAPI files depending on which OS you want to support. There are a variety of functions in those that allow you to list processes, terminate processes, etc.
-
You'll have to download PSAPI: http://www.microsoft.com/downloads/details.aspx?FamilyID=3d1fbaed-d122-45cf-9d46-1cae384097ac&DisplayLang=en There is function in there which lists processes. If I remember correctly, I think it uses a callback, but that may only be for 16-bit processes. There is also a function that will allow you to terminate a process. You'll have to put the dll on your target machine and declare the functions in your vb code.
-
Yopu might try posting a wm_close message to it's main window first - this will allow it to do any proper cleanup like closing files etc. Ideally you should only terminate a process using Terminateprocess if it has hung...IMHO. '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd