When I start a new process, what difference does it make if I use the
WindowStyle = Hidden
or the
CreateNoWindow = true
<
Using Reflector, it looks like WindowStyle is used if UseShellExecute is set, otherwise it uses CreateNoWindow.
In MSDN's example, you can see how they set it:
// Using CreateNoWindow requires UseShellExecute to be false
myProcess.StartInfo.UseShellExecute = false;
// You can start any process, HelloWorld is a do-nothing example.
myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
In the other example, its just below because UseShellExecute is defaulted to true
// UseShellExecute defaults to true, so use the WindowStyle
ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;