The TerminateThread function terminates a thread.
HANDLE hThread, // handle to thread
DWORD dwExitCode // exit code
[in/out] Handle to the thread to terminate.
Windows NT/2000 or later: The handle must have THREAD_TERMINATE access. For more information, see Thread Security and Access Rights.
[in] Specifies the exit code for the thread. Use the GetExitCodeThread function to retrieve a thread's exit value.