TerminateProcess
TerminateProcess is a Windows API function used to immediately terminate a specified process and all of its threads. It is provided by the Windows operating system to end a running process from another process or from a debugger.
The function signature is BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode). The hProcess parameter must be a handle
Behavior and safety considerations: TerminateProcess ends the target process abruptly, without giving the process a chance
Return value and errors: The function returns a nonzero value if the termination succeeds; otherwise it returns
Related concepts: For a graceful shutdown, other mechanisms such as sending a close message to a user