How to find out if a computer is in game mode

Background

I am using a simple WIN32 application consisting of a window. The user can show / hide the window using a special hotkey. I will register the RegisterHotKey hotkey and respond to WM_HOTKEY

Problem

if the user plays the game and accidentally (or not accidentally) presses a combination of hot keys, my window appears, and as a result, the game is minimized.

Question

Is there a (own) way to find out that the user is in game mode or in any other special mode that I can disable the hotkey response

Note

I would also like it if windows did this function while I play games. For example, do not respond to WinKey + D while I'm in game mode.

+5
source share
1 answer

You can use the SHQueryUserNotificationState function to determine if the user is playing a full-screen D3D game. He will report QUNS_RUNNING_D3D_FULL_SCREEN .

+8
source

Source: https://habr.com/ru/post/1247452/


All Articles