How to use SetWindowsHookEx in Vista and hook Admin apps with UAC?

时间秒杀一切 提交于 2019-12-08 01:38:28

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/3169675/how-to-use-setwindowshookex-in-vista-and-hook-admin-apps-with-uac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!