title: ProcessStartInfo.UseShellExecute = true and waiting for process exit
body: <p>I want to use shell executable in order to respect user preferences of application to be started, but I also need to know when that particular application is closed.</p>
  
  <pre><code>Process editProcess = new Process();
  ProcessStartInfo startInfo = new ProcessStartInfo();
  startInfo.FileName = filename;
  startInfo.Verb = "edit";
  startInfo.UseShellExecute = true;
  editProcess.StartInfo = startInfo;
  
  // start the default editor
  editProcess.Start();
  editProcess.WaitForExit();
  </code></pre>
  
  <p>WaitForExit seems to return when the shell process exits and not when the real process exits.</p>
  
  <p>Is there a better way of knowing when started application is exited than manually parsing registry, finding correct application to start and explicitly start that app without shell execute?</p>