Need to find HProcess for a console app so I can TerminateProcess()
Posted on 2000-05-11
I have some trouble with a CGI program hanging sometimes and want to have some way to find out the HProcess so I can have another application kill it if necessary.
Most likely since it is a console app, I doubt it would have a window handle so that makes this harder. What I thought might work would be to have the troublesome application mark it's HProcess number in the registry and remove it upon successful completion. I don't know how to get that number since that number generally comes from CreateProcess which is done by MicroSoft Internet Information Server.
Too bad it takes sooo long for the application to "die" on it's own otherwise this wouldn't be necessary. IIS seems to own the instance of the application and prohibit the normal user's Task manager "End process".
I'm hoping that if I have another IIS-run program, it could terminate any/all rogue processes. Hopefully this will be possible because I think this would make it to be in the same "context".
Thanks for your help!