1 2 3 4 5 6 7 8 9 10 11 12
| DWORD nProcessID; HANDLE hProcess = NULL; ::GetWindowThreadProcessId((HWND)handle,&nProcessID);
hProcess = ::OpenProcess(PROCESS_TERMINATE,FALSE,nProcessID);
if (!::TerminateProcess(hProcess, 0)) { DWORD derror = GetLastError(); return FALSE; } return TRUE;
|