patyork
February 28th, 2009, 10:11 PM
I'm creating a small, console app to close a running process (utorrent.exe).
I was wondering how i would go about doing that... TerminateProcess, ExitProcess, some sort of system() control?
Any input would be appreciated.
_Superman_
March 1st, 2009, 01:44 AM
Use TerminateProcess.
But it is not a clean termination.
Certain resources held by the process may become corrupt.
Igor Vartanov
March 2nd, 2009, 06:36 AM
I'm creating a small, console app to close a running process (utorrent.exe).
I was wondering how i would go about doing that... TerminateProcess, ExitProcess, some sort of system() control?The best way is to go the way a regular user does: send Exit command. Find out the Exit menu item command id and send that command message to the utorrent.exe window. Use Spy++ for finding out the mentioned id value.