is msdn wrong when it says that to use ProcessWindowStyle.Hidden the ProcessStartInfo.UseShellExecute property must be false ?
https://msdn.microsoft.com/en-us/library/system.diagnostics.processwindowstyle(v=vs.110).aspx
Firstly it's not ProcessStartInfo.UseShellExecute, it's an instance of ProcessStartInfo dot UseShellExecute but that aside.
Secondly, and most importantly. I find the opposite is true
If I create e.g. a winforms application, with this code Then a cmd window appears
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "cmd.exe";
psi.UseShellExecute = false;
psi.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(psi);
If however I do
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "cmd.exe";
psi.UseShellExecute = true; //default
psi.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(psi);
Then the cmd window doesn't appear.
So it seems that ProcessWindowStyle.Hidden requires UseShellExecute to be true/default. Not false. Exactly the opposite of what msdn says.
Is msdn completely wrong in its documentation, or am I misunderstanding it?
Also, this answer here .NET - WindowStyle = hidden vs. CreateNoWindow = true? backs up what i've found that CreateNoWindow is for when UseShellExecute = false, and psi.WindowStyle=ProcessWindowStyle.Hidden is for when UseShellExecute=true(default). Msdn points that out for CreateNoWindow but msdn seems to be get it wrong with ProcessWindowStyle.Hidden.