问题描述
我正在尝试确定用户帐户控制当前是否正在黑屏/请求许可.
I am trying to determine if User Account Control is currently blacking out the screen/asking for permission.
我有一个使用 SlimDX 的应用程序,当 UAC 接管屏幕时,它会导致 DirectX 设备丢失,一旦 UAC 窗口关闭,我可以重新创建设备,如果我之前尝试过(即使在尝试中{}catch{} 并循环应用程序崩溃)
I have an application which uses SlimDX and when UAC takes over the screen it causes the DirectX device to be lost, I can recreate the device once the UAC window has been closed, if I try this before(even in a try{}catch{} and loop the application crashes)
我查看了 pinvoke 和 msdn,但似乎找不到任何关于此的信息.有人有想法吗?
I have looked over at pinvoke and msdn and I can't seem to find anything about this. Does anyone have an ideas?
注意:我不想以任何方式与这些提示交互,我只想检查它们是否打开,以便我可以延迟创建 DirectX 设备.
As a note: I do not want to interact with these prompts in any way, I only want to check if they are open so I can delay the creation of my DirectX device.
推荐答案
如果当前屏幕上显示 UAC 提示,则 C:\Windows\System32\consent.exe
将运行.有一些方法可以在程序启动或停止时收到事件通知,您可以使用它们并让您的程序执行操作以在同意.exe 程序终止后重新创建 DirectX 设备.
If a UAC prompt is currently on screen then C:\Windows\System32\consent.exe
will be running. There are ways to be notified with a event when a program starts or stops, you can use them and have your program perform the action to recreate the DirectX device after the consent.exe program terminates.
这篇关于如何检查 UAC 当前是否正在黑屏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!