The following code works:
const auto explorer = OpenProcess(PROCESS_TERMINATE, false, process_id);
TerminateProcess(explorer, 1);
CloseHandle(explorer);
More Related Contents:
- How can I get a process handle by its name in C++?
- How to detect win32 process creation/termination in c++
- C++ Get Username From Process
- How to query a running process for its parameters list? (Windows, C++)
- Load the same dll multiple times [closed]
- Getting another process command line in Windows
- How to create a process in C++ on Windows?
- Title Name not showing and background color not changing
- Windows LoadCursor – Does it return the same HCURSOR value each time?
- How to get main window handle from process id?
- Can I use CreateFile, but force the handle into a std::ofstream?
- Precise thread sleep needed. Max 1ms error
- How would I load a PNG image using Win32/GDI (no GDI+ if possible)?
- How do I use a third-party DLL file in Visual Studio C++?
- Correctly reading a utf-16 text file into a string without external libraries?
- CreateProcess doesn’t pass command line arguments
- What does LPCWSTR stand for and how should it be handled?
- How to get a list of video capture devices (web cameras) on windows? (C++)
- How might I wrap the FindXFile-style APIs to the STL-style Iterator Pattern in C++?
- Win32: How to hide 3rd party windows in taskbar by hWnd
- Is there a clean way to prevent windows.h from creating a near & far macro?
- Explicitly initialize DWORD to 1, but debugger shows wildly out of range value
- Why there are three unexpected worker threads when a Win32 console application starts up? [duplicate]
- How can I enumerate/list all installed applications in Windows XP?
- How to get hWnd of window opened by ShellExecuteEx.. hProcess?
- How to get the starting/base address of a process in C++?
- DoEvents equivalent for C++?
- Is a memory barrier required to read a value that is atomically modified?
- Win32: Bring a window to top
- Are there any downsides to using UPX to compress a Windows executable?