I only know the HWND as an input, first I use GetWindowThreadProcessId to get the process ID. But then how can I convert the process ID as the first input parameter of TerminateProcess which is HANDLE?
Code:
DWORD dwProcessID = 0;
::GetWindowThreadProcessId(hWndGot, &dwProcessID);
Thanks in advance!