Direct3D full-screen application discovery

Is there a way to detect - through the Direct3D API - Direct3D applications running in full screen?

SHQueryUserNotificationState , which can specify such applications, is supported only in Vista and above. It also only works when starting the Explorer shell.

+4
source share
2 answers

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 ...

+2
source

Try 'IDirect3DDevice9 :: GetDisplayMode':

http://msdn.microsoft.com/en-us/library/bb174387%28VS.85%29.aspx

 HRESULT GetDisplayMode( UINT iSwapChain, D3DDISPLAYMODE * pMode ); 

Options:

iSwapChain [in]

 An unsigned integer specifying the swap chain. 

pMode [out]

 Pointer to a D3DDISPLAYMODE structure containing data about the 

adapter display mode. In the view against the display mode, a device that may not be active if the device does not have a full-screen mode.

0
source

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


All Articles