title: Will Process.WaitForInputIdle Method serve my purpose of waiting for process to start?
body: <p>We have an exe application (VB6). This app is called by our .NET dll assembly (using <code>Process.Start</code>) which passes username and password to the vb6 app as arguments.
  The VB6 app has code which looks for windows messages only after login code is executed. </p>
  
  <p>It works well if I do :-</p>
  
  <p><strong>CASE1:</strong></p>
  
  <pre><code>Process.Start("file.exe", arguments);
  Thread.Sleep(1000); //if I comment this line then the msg is never caught by the vb6 app
  SendAWindowsMsg("hello");
  </code></pre>
  
  <p><strong>CASE2:</strong></p>
  
  <pre><code>var process = new Process
  {
      StartInfo = new ProcessStartInfo
      {
          FileName = @"file.exe",
          Arguments = arguments
      }
  };
  process.Start();
  process.WaitForInputIdle();
  SendAWindowsMsg("hello");
  </code></pre>
  
  <p>My question is: Will case 1 or case 2 be the better approach? What is the meaning of <code>WaitForInputIdle</code> (what's the input and idle thing?)?</p>