mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
[PTRun]Detect full-screen games with QUNS_RUNNING_D3D_FULL_SCREEN (#30797)
* Add SHQueryUserNotificationState to NativeMethods * Check for QUNS_RUNNING_D3D_FULL_SCREEN in IsWindowFullscreen The current test for whether a window is full-screen (i.e. a movie or a game) is a bit of a heuristic. In certain cases however, we can *know* that a window is full-screen. Check that case first, then proceed with the existing logic * Make spellchecker happier
This commit is contained in:
@@ -112,6 +112,15 @@ namespace PowerLauncher.Helper
|
||||
|
||||
public static bool IsWindowFullscreen()
|
||||
{
|
||||
// First, check to see if a game is fullscreen, if so, we definitely have
|
||||
// a full-screen window
|
||||
UserNotificationState state;
|
||||
if (Marshal.GetExceptionForHR(NativeMethods.SHQueryUserNotificationState(out state)) == null &&
|
||||
state == UserNotificationState.QUNS_RUNNING_D3D_FULL_SCREEN)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// get current active window
|
||||
IntPtr hWnd = NativeMethods.GetForegroundWindow();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user