chafey
May 6th, 1999, 12:47 PM
Hi
Is there anyway to have NT automatically terminate all child processes created by a process when that process is terminated itself? I have a process monitor program which launches several processes, but the child processes are not being cleaned up if I terminate the parent monitor process from task manager or by stopping the debug session from within Developer Studio. Although I don't plan on having users stop the process monitor by killing it, I would like to handle this situation properly. I would also like this cleanup to occur when I am debugging the parent process(killing the spawned children from task manager is time consuming). I have this kind of working by adding the DEBUG_ONLY_THIS_PROCESS flag to the creation flags when creating the process. Unfortunately the child processes don't use the parent process's console window with this flag. The process monitor is a console application and all spawned children are console applications. The process monitor itself will eventually be a NT Service. Any ideas?
Chris Hafey
PS - Does anyone know the header file that declares IsDebuggerPresent()? The doc's don't specify one and I couldn't find it in the VC header files when I did a search! I ended up declaring it myself.
Is there anyway to have NT automatically terminate all child processes created by a process when that process is terminated itself? I have a process monitor program which launches several processes, but the child processes are not being cleaned up if I terminate the parent monitor process from task manager or by stopping the debug session from within Developer Studio. Although I don't plan on having users stop the process monitor by killing it, I would like to handle this situation properly. I would also like this cleanup to occur when I am debugging the parent process(killing the spawned children from task manager is time consuming). I have this kind of working by adding the DEBUG_ONLY_THIS_PROCESS flag to the creation flags when creating the process. Unfortunately the child processes don't use the parent process's console window with this flag. The process monitor is a console application and all spawned children are console applications. The process monitor itself will eventually be a NT Service. Any ideas?
Chris Hafey
PS - Does anyone know the header file that declares IsDebuggerPresent()? The doc's don't specify one and I couldn't find it in the VC header files when I did a search! I ended up declaring it myself.