Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/76
This commit is contained in:
Max
2026-05-03 16:27:51 +00:00
committed by sh0inx
parent 2b929c5537
commit c1c47d308d
2 changed files with 19 additions and 24 deletions

View File

@@ -16,6 +16,15 @@ namespace Ryujinx.Common.Helper
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool ShowWindow(nint hWnd, int nCmdShow);
[SupportedOSPlatform("windows")]
[LibraryImport("user32")]
private static partial nint GetForegroundWindow();
[SupportedOSPlatform("windows")]
[LibraryImport("user32")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool SetForegroundWindow(nint hWnd);
public static bool SetConsoleWindowStateSupported => OperatingSystem.IsWindows();
public static void SetConsoleWindowState(bool show)
@@ -44,6 +53,10 @@ namespace Ryujinx.Common.Helper
return;
}
SetForegroundWindow(hWnd);
hWnd = GetForegroundWindow();
ShowWindow(hWnd, show ? SW_SHOW : SW_HIDE);
}
}