views:

47

answers:

1

Right now, I'm using:

TerminateProcess(pi.hProcess, 0)

... but this doesn't allow the application to clean up.

Our application has a wndProc function, but when I send WM_CLOSE...

PostThreadMessage(pi.dwThreadId, WM_CLOSE, 0, 0);

The function doesn't seem to be getting the message.

pi is of type: PROCESS_INFORMATION
+2  A: 

Find your window handle (hWnd)

and call SendMessage(hWnd,WM_CLOSE,0,0);

Indeera