mirror of
https://github.com/duke-git/lancet.git
synced 2025-09-26 19:41:20 +08:00
27 lines
343 B
Go
27 lines
343 B
Go
//go:build windows
|
|
|
|
package system
|
|
|
|
import (
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
func WithWinHide() Option {
|
|
return func(c *exec.Cmd) {
|
|
if c.SysProcAttr == nil {
|
|
c.SysProcAttr = &syscall.SysProcAttr{
|
|
HideWindow: true,
|
|
}
|
|
} else {
|
|
c.SysProcAttr.HideWindow = true
|
|
}
|
|
}
|
|
}
|
|
|
|
func WithForeground() Option {
|
|
return func(c *exec.Cmd) {
|
|
|
|
}
|
|
}
|