Well, since you just want to close the program you could use TerminateProcess(hProcess, 0);
Slavisa
Well, since you just want to close the program you could use TerminateProcess(hProcess, 0);
Slavisa
I think it is better to send WM_CLOSE to the window instead of calling DestroyWindow().
Slavisa
You can use EnumWindows() or EnumThreadWindows() to enumerate top level windows and GetWindowThreadProcessid() to check if specific window is created by your process (processInfo.dwProceddId)
Slavisa