Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting full screen mode in Windows

Tags:

c++

winapi

I need to detect if some application is currently running in full screen mode. If yes, then I must stop my application. So, how can I detect that? p.s. Win32 C++

like image 472
lebron2323 Avatar asked Aug 10 '11 10:08

lebron2323


People also ask

How can I see my full screen?

On a Windows computer, you can set Google Chrome, Internet Explorer, Microsoft Edge, or Mozilla Firefox to full-screen mode, hiding the toolbars and address bar by pressing the F11 key. To reverse this action and show these items again, press F11 again.

How do I get my computer off full screen mode?

Using the F11 key on your computer's keyboard will let you both enter and exit full-screen mode in many applications. If you use a laptop, you might need to press Fn + F11 to activate this keyboard shortcut.

How do I get full screen with F11?

Fullscreen mode on a Windows computer To exit the standard view with the address bar, status bar, etc., always showing, press F11 on your keyboard to enter fullscreen. Pressing F11 again goes back to normal view.


1 Answers

All other answers are rather hackish.

Windows Vista, Windows 7 and up support this:

QUERY_USER_NOTIFICATION_STATE pquns;
SHQueryUserNotificationState(&pquns);

QUNS_BUSY and QUNS_RUNNING_D3D_FULL_SCREEN indicate a fullscreen app running (the F11 or a videogame fullscreen, not a maximized window). Videogames I tried use just QUNS_BUSY on Windows 10, I was unable to trigger QUNS_RUNNING_D3D_FULL_SCREEN.

QUNS_PRESENTATION_MODE indicates a special Windows mode for showing presentations on a projector, effectively fullscreen mode, too.

like image 119
Andrey Moiseev Avatar answered Oct 04 '22 16:10

Andrey Moiseev