Is there any way to detect - through the Direct3D API - Direct3D applications running in full-screen mode?
SHQueryUserNotificationState, which can indicate such applications, is only supported on Vista and up. It also only works when the Explorer shell is running.
I found how to detect full-screen Direct3D and OpenGL (for example Minecraft) applications.
Call IDirectDraw7::TestCooperativeLevel(). This function returns
DDERR_EXCLUSIVEMODEALREADYSET
if active full-screen Direct3D application is running or if user session is not active (Win+L, Alt+Ctrl+Del, Fast User Switching, etc).Note: Call
DirectDrawCreateEx
withDDCREATE_EMULATIONONLY
. This dramatically reduces resources usage by IDirectDraw7.I have tested this method only in Windows 7 SP1 x64 with 1 display.
BTW
SHQueryUserNotificationState()
returnsQUNS_BUSY
instead ofQUNS_RUNNING_D3D_FULL_SCREEN
for full-screen games. Strange...Try 'IDirect3DDevice9::GetDisplayMode':
http://msdn.microsoft.com/en-us/library/bb174387%28VS.85%29.aspx