UAC式的提升提示 [英] UAC-style elevated prompt

查看:174
本文介绍了UAC式的提升提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣在一个临时会话,像UAC提示的显示方式发射的窗口。还有的是从少数人这个概念有些兴趣,所以我想我会在这里提问。从本质上讲就是我们要去的是提升窗口像UAC你确定要到< ...>的提示,但任意窗口。最终的目标是防止窗口事件挂钩和各种输入密码过程中可能出现的其他问题。

I'm interested in launching a window in a temporary session, like how UAC prompts appear. There's been some interest in this concept from a few people, so I figured I'd ask here. Essentially what we're going for is an elevated window like the UAC "are you sure you want to <...>" prompts, but with an arbitrary window. The end goal is to prevent window event hooks and all sorts of other issues that might occur during password entry.

我有一个快速浏览一下UAC的API和其他一些地方,但没有什么特别有用在那里。显然,UAC提示获得提升自己的桌面会话的不知何故的,所以必须有建立在这样一种方式的窗口的方式。

I've had a quick look at the UAC APIs and a few other places, but there's nothing particularly useful out there. Obviously the UAC prompts get elevated to their own desktop session somehow, so there must be a way to create windows in such a way.

推荐答案

您可以创建一个使用的 CreateDesktop 。您可以使用 SwitchDesktop 切换到新的桌面。然后,你可以调用 SetThreadDesktop 你的主线程,并绘制你的窗口。要返回调用的 OpenDesktop 与默认为的 lpszDesktop 的,并使用SwitchDesktop这个句柄。您也可以在一定的桌面上运行的进程。为了做到这一点,你必须设置的 lpDesktop 的成员0.85%29.aspx相对=nofollow> STARTUPINFO 结构到桌面的名字过程中应运行。使用它们(的 CloseDesktop )。

You can create a desktop using CreateDesktop. You can use SwitchDesktop to switch to the new desktop. Then you can call SetThreadDesktop on your main thread and draw your window. To get back get the handle of the default desktop by calling OpenDesktop with "Default" as lpszDesktop and use SwitchDesktop with this handle. You can also run Processes on a certain desktop. In order to do this you have to set lpDesktop member of the STARTUPINFO structure to the name of the desktop the process should be run on. Close the handles to the desktops after using them (CloseDesktop).

您可以显示这样一个自己的桌面上你自己的窗口。

You can show your own window on an own desktop in this way.

由UAC和登录界面中使用的安全桌面被称为Winlogon中。为了访问它,你需要系统权限。卢克在提供的他的答案之一。

The secure desktop used by UAC and by the Logon UI is called "Winlogon". In order to access it you need system rights. Luke provided an example in one of his answers.

布莱恩R.邦迪写了的博客台式机和窗口站入口的这是值得一读。

Brian R. Bondy wrote a blog entry on desktops and window stations which is worth reading.

这篇关于UAC式的提升提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆