summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/exec_windows.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-28 10:35:15 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-28 10:35:15 +0200
commitc1ba1a0fec4aed430709030f98a3bdb90bfeea16 (patch)
tree3df18657e50a0313ed6defcda30e4474cb28a467 /src/pkg/syscall/exec_windows.go
parent7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (diff)
downloadgolang-c1ba1a0fec4aed430709030f98a3bdb90bfeea16.tar.gz
Imported Upstream version 2011.04.27upstream/2011.04.27
Diffstat (limited to 'src/pkg/syscall/exec_windows.go')
-rw-r--r--src/pkg/syscall/exec_windows.go14
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]