
How to terminate a process created with CreateProcess(...)
Hai there,
In try to start and stop an application from my program.
To start the application i use the CreateProcess call who gives me
PROCESS_INFORMATION on return.
To stop the application i used the TerminateProcess call but this
call doesn't clean up the started applications administration completely
(see help pages) which makes it impossible to start some applications
for
the second time. So i can't use the TerminateProcess call.
A better solution for this problem is to sent a WM_CLOSE message to
the started application but i only can sent messages if a know the
main HWND of the started application.
My question:
How can i obtain the HWND of the main windows of the started
application when i only have the PROCESS_INFORMATION returned by
CreateProcess?
Any suggestions?
I'm using VC++ 4.2b under Windows 95.
Please reply by Email.
Ruud Cox
Eindhoven, Netherlands