title: How can I kill completely a process while using CreateNoWindow = true
body: <p>I have a problem that I can't terminate a running process
  when I set <code>UseShellExcute = false</code> and <code>CreateNoWindow = true</code>. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>startInfo.RedirectStandardError = true;
  startInfo.UseShellExecute = false;
  startInfo.CreateNoWindow = true;
  process.StartInfo = startInfo;
  process.Start();
  Boolean TimeLimit = process.WaitForExit(2000);
  if (TimeLimit == false)
  {
      process.Kill();
      return "Time Limit Exceeded";
  }
  </code></pre>
  
  <p>After the program exit, the process is still running (checked in Task Manager)<br>
  If I set <code>CreateNoWindow = false</code> and use <code>closeMainWindow</code> like this:  </p>
  
  <pre><code>startInfo.RedirectStandardError = true;
  startInfo.UseShellExecute = false;
  startInfo.CreateNoWindow = false;
  process.StartInfo = startInfo;
  process.Start();
  Boolean TimeLimit = process.WaitForExit(2000);
  if (TimeLimit == false)
  {
      process.CloseMainWindow();
      return "Time Limit Exceed";
  }
  </code></pre>
  
  <p>it works fine.
  But I don't want it to show the window while running.</p>
  
  <p>is there any other way to do this? I need some help</p>