mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
22 lines
488 B
Go
22 lines
488 B
Go
//go:build windows
|
|
|
|
package winapi
|
|
|
|
var (
|
|
procGetConsoleWindow = Kernel32.NewProc("GetConsoleWindow")
|
|
procShowWindow = User32.NewProc("ShowWindow")
|
|
)
|
|
|
|
const swHide = 0
|
|
|
|
// HideConsoleWindow hides the console window attached to the current
|
|
// process. Returns true if the window was previously visible.
|
|
func HideConsoleWindow() bool {
|
|
hwnd, _, _ := procGetConsoleWindow.Call()
|
|
if hwnd == 0 {
|
|
return false
|
|
}
|
|
prev, _, _ := procShowWindow.Call(hwnd, swHide)
|
|
return prev != 0
|
|
}
|