internal/ui: skip hideConsoleWindowOnWindows in Xbox

Updates #2084
This commit is contained in:
Hajime Hoshi 2022-05-25 00:13:26 +09:00
parent 3745c0a2e0
commit 55657e72ae

View File

@ -49,6 +49,11 @@ func getConsoleWindow() windows.HWND {
// hideConsoleWindowOnWindows will hide the console window that is showing when // hideConsoleWindowOnWindows will hide the console window that is showing when
// compiling on Windows without specifying the '-ldflags "-Hwindowsgui"' flag. // compiling on Windows without specifying the '-ldflags "-Hwindowsgui"' flag.
func hideConsoleWindowOnWindows() { func hideConsoleWindowOnWindows() {
// In Xbox, GetWindowThreadProcessId might not exist.
if user32.NewProc("GetWindowThreadProcessId").Find() != nil {
return
}
pid := windows.GetCurrentProcessId() pid := windows.GetCurrentProcessId()
// Get the process ID of the console's creator. // Get the process ID of the console's creator.