I need a way to kill a program which was started with CreateProcess.
My CreateProcess line:
I want to send WM_CLOSE with PostMessage, wait for 2 seconds and if program is still running use TerminateProcess.
CreateProcess sA, sB, ByVal 0&, ByVal 0&, 1, 0&, ByVal 0&, vbNullString, si, pi
I had no luck in doing any of that. TerminateProcess is working only if I call it straight after CreateProcess, if I want 1 second for example it is no longer working. EnumWindows API is somehow also not working, so I cannot use PostMessage.