How to kill a process?

Nov 25, 2011 at 10:21pm
How to use C++ to stop a running process on Windows?
Nov 25, 2011 at 10:35pm
You "just" obtain a handle (HPROCESS) to the process and call TerminateProcess() on it.

The catch it that you're got be able to obtain PROCESS_TERMINATE access right to handle, which usually means you have to be an administrator, and then you have to explicity grant yourself SeDebugPrivilege privilege.

Andy

PS Technically, you're not using C++ to stop the process; you're calling a WIN32 API function (which is C) using C++.
Last edited on Nov 25, 2011 at 10:52pm
Topic archived. No new replies allowed.