c# - is msdn wrong when it says ProcessWindowStyle.Hidden requires UseShellExecute=false? -
is msdn wrong when says use processwindowstyle.hidden processstartinfo.useshellexecute property must false ?
https://msdn.microsoft.com/en-us/library/system.diagnostics.processwindowstyle(v=vs.110).aspx
firstly it's not processstartinfo.useshellexecute, it's instance of processstartinfo dot useshellexecute aside.
secondly, , importantly. find opposite true
if create e.g. winforms application, code cmd window appears
processstartinfo psi = new processstartinfo(); psi.filename = "cmd.exe"; psi.useshellexecute = false; psi.windowstyle = processwindowstyle.hidden; process.start(psi);
if do
processstartinfo psi = new processstartinfo(); psi.filename = "cmd.exe"; psi.useshellexecute = true; //default psi.windowstyle = processwindowstyle.hidden; process.start(psi);
then cmd window doesn't appear.
so seems processwindowstyle.hidden requires useshellexecute true/default. not false. opposite of msdn says.
is msdn wrong in documentation, or misunderstanding it?
also, answer here .net - windowstyle = hidden vs. createnowindow = true? backs i've found createnowindow when useshellexecute = false, , psi.windowstyle=processwindowstyle.hidden when useshellexecute=true(default). msdn points out createnowindow msdn seems wrong processwindowstyle.hidden.
Comments
Post a Comment