Skip to content

Commit

Permalink
internal/ui: skip hideConsoleWindowOnWindows in Xbox
Browse files Browse the repository at this point in the history
Updates #2084
  • Loading branch information
hajimehoshi committed May 24, 2022
1 parent 3745c0a commit 55657e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/ui/hideconsole_windows.go
Expand Up @@ -49,6 +49,11 @@ func getConsoleWindow() windows.HWND {
// hideConsoleWindowOnWindows will hide the console window that is showing when
// compiling on Windows without specifying the '-ldflags "-Hwindowsgui"' flag.
func hideConsoleWindowOnWindows() {
// In Xbox, GetWindowThreadProcessId might not exist.
if user32.NewProc("GetWindowThreadProcessId").Find() != nil {
return
}

pid := windows.GetCurrentProcessId()

// Get the process ID of the console's creator.
Expand Down

0 comments on commit 55657e7

Please sign in to comment.