Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to create process as "hidden" in windows , and i found os.ProcAttr.Sys.HideWindow is not useful.
Unfortunately, there are not CREATE_NO_WINDOW in syscall/ztypes_windows.go.
hence, if i want create a daemon process in windows , and which won't be closed while the console quit, i should code as below:
var attr os.ProcAttr attr.Sys = &syscall.SysProcAttr{} attr.Sys.CreationFlags = 0x08000000 attr.Sys.HideWindow = true os.StartProcess("foo", []string{}, &attr)
The text was updated successfully, but these errors were encountered:
We're missing some Windows constants from https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx in the syscall package.
Maybe they belong in x/syscall/windows instead.
Sorry, something went wrong.
I don't see a problem here. You code works fine as expected. Maybe change it to:
const CREATE_NO_WINDOW = 0x08000000 var attr os.ProcAttr attr.Sys = &syscall.SysProcAttr{} attr.Sys.CreationFlags = CREATE_NO_WINDOW attr.Sys.HideWindow = true os.StartProcess("foo", []string{}, &attr)
so you understand what it does next time you have to look at it. There are many consts defined in Windows .h files. We cannot have them all include in Go standard packages. Why should we include CREATE_NO_WINDOW and not others?
Alex
No branches or pull requests
I want to create process as "hidden" in windows , and i found os.ProcAttr.Sys.HideWindow is not useful.
Unfortunately, there are not CREATE_NO_WINDOW in syscall/ztypes_windows.go.
hence, if i want create a daemon process in windows , and which won't be closed while the console quit,
i should code as below:
The text was updated successfully, but these errors were encountered: