title: Monitor child processes of a process
body: <p>I'm running .exe file using this code:</p>
  
  <pre><code>Process proc = Process.Start("c:\program.exe");
  proc.WaitForExit();
  </code></pre>
  
  <p>If I start <code>Stopwatch</code> before starting the process and stop it after <code>proc.WaitForExit();</code> line, I can get the time that user was using that particular program.</p>
  
  <p>The problem I'm facing is that some programs (and games) use launchers - some small .exe file that usually checks something and then launches another .exe file that is actually the program/game that the user wants to run. In these cases the code above doesn't work because it returns after launcher exists.</p>
  
  <p>How can I track all processes that <code>proc</code> runs, and wait unitl all of them are terminated?</p>