I'm working on a win32 application that opens a console program using CreateProcess(). I can close the console window later using TerminateProcess(), but it doesn't close until it wants to. I would lke to do an unconditional close, like when I click on the upper right close icon. The window also closes via a CTRL+C, but not by using SetFocus() and keybd_event(). I have also tried OpenProcess(DELETE, FALSE, processInfo.dwProcessId); which succeeded in acquiring a handle, but did not delete the process. I am unable to figure out if it is a security attribute problem or something else.
Thanks for any help.