title: How to wait until a process terminates before continuing to execute - C#
body: <p>So I launch a bunch of process to convert some audio files and i want my main program to wait until all of those process complete before executing.</p>
  
  <pre><code>        System.Diagnostics.Process process = new System.Diagnostics.Process();
          System.Diagnostics.ProcessStartInfo stratInfo = new System.Diagnostics.ProcessStartInfo();
          stratInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
          DirectoryInfo di = new DirectoryInfo(@dir);
          foreach (FileInfo fi in di.GetFiles())
              {
                  stratInfo.FileName = "C:\\AudioExtract.exe";
                  stratInfo.Arguments = "-a \"" + dir + "\\" + fi.Name + "\"";
                  process.StartInfo = stratInfo;
                  process.Start();
              }
                  foreach (Process clsProcess in Process.GetProcesses())
                  {
                      if (clsProcess.ProcessName.Contains("AudioExtract.exe"))
                      {
                          StatusLbl.Text = "Found!";
                      }
                  }
  </code></pre>
  
  <p>Thats what i have to see if it is running, but i need it to continue updating the getprocesses and check if it is still running and im not quite sure how.</p>
  
  <p>My app launches Many of the same process for different audio files, almost simultaneously. I looked at the link in the comment and that will set up an event handler, how would i handle many of the same event everytime one of the processes exit?</p>