diff options
Diffstat (limited to 'src/pkg/syscall/exec_windows.go')
-rw-r--r-- | src/pkg/syscall/exec_windows.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/pkg/syscall/exec_windows.go b/src/pkg/syscall/exec_windows.go index aeee191dd..85b1c2eda 100644 --- a/src/pkg/syscall/exec_windows.go +++ b/src/pkg/syscall/exec_windows.go @@ -8,6 +8,7 @@ package syscall import ( "sync" + "unsafe" "utf16" ) @@ -217,9 +218,10 @@ func joinExeDirAndFName(dir, p string) (name string, err int) { } type ProcAttr struct { - Dir string - Env []string - Files []int + Dir string + Env []string + Files []int + HideWindow bool } var zeroAttributes ProcAttr @@ -279,8 +281,12 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, } } si := new(StartupInfo) - GetStartupInfo(si) + si.Cb = uint32(unsafe.Sizeof(*si)) si.Flags = STARTF_USESTDHANDLES + if attr.HideWindow { + si.Flags |= STARTF_USESHOWWINDOW + si.ShowWindow = SW_HIDE + } si.StdInput = fd[0] si.StdOutput = fd[1] si.StdErr = fd[2] |