如何在Vista中使用SetWindowsHookEx并将Admin应用程序与UAC挂钩? [英] How to use SetWindowsHookEx in Vista and hook Admin apps with UAC?
问题描述
我正在尝试确定是否有一种方法可以使用SetWindowsHookEx,并且能够影响在启用了UAC的情况下在Vista上以管理员权限运行的应用程序.这是一个应用程序,需要在其他窗口的标题栏上添加一个小按钮以启用某些多显示器感知的处理.我本以为无法做到这一点,但是我看到一个出现的应用程序可以做到这一点.据我所知,该其他应用程序未使用管理员权限运行,但它可能会影响系统中的所有应用程序,包括那些具有管理员权限的应用程序.
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.
推荐答案
您不能这样做,因为管理进程与在同一用户桌面上运行的非管理进程是隔离的.您甚至无法在管理和非管理进程之间拖放.
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.
这是一项深入的分析: http://technet .microsoft.com/en-us/magazine/2007.06.uac.aspx
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.
这篇关于如何在Vista中使用SetWindowsHookEx并将Admin应用程序与UAC挂钩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!