I'm looking for a way to detect if a Process started by my application has in turn spawned additional Processes. The hope is that i can have a thread that starts and application, watches until it exits, and then triggers some other action when that application exits. The problem is that with some of the applications that i want to monitor, they are starting an additional process and then exiting. so my trigger fires before the application has exited.
for example, i start a program in a Process. that executable does some file patching, and then launches the main program - a separate exe - and then exits. this causes Process.HasExited to return true, which fires off my trigger prematurely. what i really care about is when the main program exits, in this case the program that the initial Process started, but i can't seem to find a way to do this programatically.