Files
go-worm/lib/helpers/hide_windows.go
T
kato cc2b1d049b fix(windows): prevent console window flash
- Centralize hidden-process setup per OS
- Hide console early to avoid startup flash
- Keep capture window off-screen and hidden
- Enable unified scheduler for watchdog task
- Force GUI subsystem in build script
2026-09-01 23:25:06 +03:00

29 lines
675 B
Go

//go:build windows
package helpers
import (
"syscall"
"golang.org/x/sys/windows"
)
// HiddenSysProcAttr starts a process with no console window.
func HiddenSysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{
HideWindow: true,
CreationFlags: windows.CREATE_NO_WINDOW,
}
}
// HiddenDetachedSysProcAttr is HiddenSysProcAttr plus a new process group so
// the child survives after the parent exits (install relaunch, updates).
func HiddenDetachedSysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{
HideWindow: true,
CreationFlags: windows.CREATE_NO_WINDOW |
windows.CREATE_NEW_PROCESS_GROUP |
windows.DETACHED_PROCESS,
}
}