c# - .NET - WindowStyle = hidden vs. CreateNoWindow = true? -
when start new process, difference make if use
windowstyle = hidden
or
createnowindow = true
property of processstartinfo
class?
as hans said, windowstyle recommendation passed process, application can choose ignore it.
createnowindow controls how console works child process, doesn't work alone.
createnowindow works in conjunction useshellexecute follows:
to run process without window:
processstartinfo info = new processstartinfo(filename, arg); info.createnowindow = true; info.useshellexecute = false; process processchild = process.start(info);
to run child process in it's own window (new console)
processstartinfo info = new processstartinfo(filename, arg); info.useshellexecute = true; // default value. process processchild = process.start(info); // separate window
to run child process in parent's console window
processstartinfo info = new processstartinfo(filename, arg); info.useshellexecute = false; // causes consoles share window process processchild = process.start(info);
Comments
Post a Comment