问题描述
是否可以通过Direct3D API检测以全屏模式运行的Direct3D应用程序?
Is there any way to detect - through the Direct3D API - Direct3D applications running in full-screen mode?
,可以这样的应用程序,仅在Vista及更高版本上受支持。
SHQueryUserNotificationState, which can indicate such applications, is only supported on Vista and up. It also only works when the Explorer shell is running.
推荐答案
我发现了如何检测全屏Direct3D和OpenGL(例如Minecraft)应用程序。
I found how to detect full-screen Direct3D and OpenGL (for example Minecraft) applications.
调用。如果正在运行的全屏Direct3D应用程序正在运行或用户会话未处于活动状态(Win + L,Alt + Ctrl + Del,快速用户切换等),则此函数返回 DDERR_EXCLUSIVEMODEALREADYSET
。
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).
注意:使用 DDCREATE_EMULATIONONLY
调用 DirectDrawCreateEx
。
我仅在具有1个显示屏的Windows 7 SP1 x64中测试了此方法。
I have tested this method only in Windows 7 SP1 x64 with 1 display.
BTW SHQueryUserNotificationState()
返回 QUNS_BUSY
而不是 QUNS_RUNNING_D3D_FULL_SCREEN
用于全屏游戏。奇怪...
BTW SHQueryUserNotificationState()
returns QUNS_BUSY
instead of QUNS_RUNNING_D3D_FULL_SCREEN
for full-screen games. Strange...
这篇关于检测全屏Direct3D应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!