Ending a process made with CreateProcess
Posted on 1997-05-10
I've made an application running under Win'95 wich uses an 3270 emulator to communicate with the MainFrame.
As soon as a user pushes a button in my application an emulator gets started up. I use CreateProcess to do this. This works perfectly.
Now I want to get rid of the emulator when the user pushes the "quit" button. I can't get this right.
When I try to use ExitProcess, MY application gets killed and NOT the emulator.
So I tried the next thing:
OpenProcess(ProcessId, bla bla). wich gives me the ProcessHandle.
This actually kills the emulator. Just as I want to. But when I try to restart my application I get errors or warnings telling me some objects and dll's can't be found.
How do I kill my Emulator (created with CreateProcess) neatly? And can someone tell me what it is that I did
Oh, and I also tried to kill the thread instead of the process,
resulting in the same thing.
I use the Winhllapi.
Thanks in advance!