I found how to detect full-screen Direct3D and OpenGL applications (e.g. Minecraft).
Call IDirectDraw7 :: TestCooperativeLevel () . This function returns DDERR_EXCLUSIVEMODEALREADYSET if the active Direct3D full-screen application is running or the user session is not active (Win + L, Alt + Ctrl + Del, fast user switching, etc.).
Note. Call DirectDrawCreateEx with DDCREATE_EMULATIONONLY . This greatly reduces resource usage with IDirectDraw7.
I tested this method only on Windows 7 SP1 x64 with 1 display.
BTW SHQueryUserNotificationState() returns QUNS_BUSY instead of QUNS_RUNNING_D3D_FULL_SCREEN for full-screen games. Strange ...
source share