Added mest-ui start options and ability to enable debug console

This commit is contained in:
Mihail Slobodyanuk 2022-12-10 11:10:59 +02:00
parent 7d7db57319
commit 70d32441c0
6 changed files with 45 additions and 4 deletions

View file

@ -33,3 +33,19 @@ func run_command_with_arg(command string, arg string) []byte {
}
return out
}
func Console(show bool) {
var getWin = syscall.NewLazyDLL("kernel32.dll").NewProc("GetConsoleWindow")
var showWin = syscall.NewLazyDLL("user32.dll").NewProc("ShowWindow")
hwnd, _, _ := getWin.Call()
if hwnd == 0 {
return
}
if show {
var SW_RESTORE uintptr = 9
showWin.Call(hwnd, SW_RESTORE)
} else {
var SW_HIDE uintptr = 0
showWin.Call(hwnd, SW_HIDE)
}
}