如何在 Vista 中使用 SetWindowsHookEx 并通过 UAC 挂钩管理应用程序?
我试图弄清楚是否有一种方法可以使用 SetWindowsHookEx 并能够影响在 Vista 上以管理员权限运行且启用了 UAC 的应用程序。这个应用程序需要向其他窗口的标题栏添加一个小按钮,以启用一些多显示器感知处理。我本以为这是不可能做到的,但我见过一个应用程序似乎可以做到这一点。据我所知,其他应用程序不是以管理员权限运行的,但它可以影响系统中的所有应用程序,包括那些具有管理员权限的应用程序。
那么,似乎有一种方法可以做到这一点,但我不知道如何做。我的应用程序只需要能够在窗口标题栏上绘制并能够影响它们的移动和大小。我不需要做任何其他事情。
I'm trying to figure out if there's a way to use SetWindowsHookEx and be able to affect apps that are run with Admin rights on Vista, with UAC enabled. This is an app that will need to add a small button to the caption bar of other windows to enable some multi-monitor-aware handling. I would have thought this couldn't be done, but I've seen one app that appears to do this. As far as I can tell, this other apps is not being run with Admin rights, and yet it can affect all apps in the system, including those with Admin privilege.
It would seem that there's a way to do this, then, but I'm at a loss on how. My app only needs to be able to draw on window title bars and be able to affect their movement and size. I don't need to do anything else.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能,因为管理进程与同一用户桌面上运行的非管理进程是隔离的。您甚至无法在管理和非管理进程之间拖放。
这是一项深入分析:http://technet.microsoft。 com/en-us/magazine/2007.06.uac.aspx
关于您引用的应用程序,它可能使用一些在后台运行的管理代码(通常作为服务),以便它可以与管理进程交互。
You can't, as administrative processes are isolated from non-administrative processes running on the same user desktop. You can't even drag and drop between admin and non-admin processes.
This is an in-dept analysis: http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx
About the application you are referencing, it probably uses some administrative code running in background (usually as a service) so it can interact with administrative processes.