title: Opening a process in C# with hidden window
body: <p>I have a function for starting processes on a local machine:</p>
  
  <pre><code>public int StartProcess(string processName, string commandLineArgs = null)
  {
      Process process = new Process();
      process.StartInfo.FileName = processName;
      process.StartInfo.Arguments = commandLineArgs;
      process.StartInfo.UseShellExecute = false;
      process.StartInfo.CreateNoWindow = true;
      process.StartInfo.ErrorDialog = false;
      process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
      process.Start();
      return process.Id;
  }
  </code></pre>
  
  <p>It is supposed to start the process without opening a new window. Indeed, when I test it with timeout.exe no console window is opened. But when I test it with notepad.exe or calc.exe their windows still open.</p>
  
  <p>I saw online that this method works for other people. I'm using .NET 4.0 on Windows 7 x64.</p>
  
  <p>What am I doing wrong?</p>