title: Retrieve a URI's "return code"?
body: <p>I have the following problem:</p>
  
  <p>I do know how to start a process and I do know how to use the <a href="https://msdn.microsoft.com/en-us/library/system.diagnostics.process%28v=vs.110%29.aspx" rel="nofollow noreferrer"><code>System::Diagnostics::Process</code></a>-class, but when I want to start a process by using its associated (and registered) URI protocol, I am unable to retrieve any information about the launched process.</p>
  
  <p>I am using the following code:</p>
  
  <pre><code>public static int Main(string[] argv)
  {
      Process p = Process.Start("myuri://some_arguments");
  
      while (!p.HasExited)
          Application.DoEvents();
  
      Console.WriteLine(p.ExitCode);
      Console.ReadKey(true);
  
      return 0;
  }
  </code></pre>
  
  <p>My C# application fails on the 5th line <em><code>while (!p.HasExited)</code></em>, as the variable <em><code>p</code></em> is <code>null</code>.
  <hr/>I am now wondering: why is this the case? And most importantly:</p>
  
  <p><strong>TL;DR:</strong> ... how can I retrieve a URI Protocol's "exit/return code"?</p>
  
  <hr/>
  
  <p><strong>EDIT NO.1:</strong> <a href="https://stackoverflow.com/a/34831271/3902603">The answer</a> from <a href="https://stackoverflow.com/users/2183486/ohw">@ohw</a> is very useful - however, I cannot use the class <a href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.system.launcher" rel="nofollow noreferrer"><code>Windows::System::Launcher</code></a>, as my target machine(s) are running on Windows7 and not on Windows8 or higher</p>