在Win7上如何在没有UAC提示的情况下通过GUI设置全局挂钩?
我想通过 SetWindowsHookEx 设置全局钩子。该钩子包装在 hook.dll 中,并由 GUI 窗口 app.exe 注册。在 Windows NT/xp 上一切正常。但是在Win7上,如何在没有UAC提示的情况下启动app.exe进程,并且可以成功加载hook.dll以在Win7上注册全局钩子?我用的是VC2005。
任何想法表示赞赏!
最美好的祝愿, 凯文
I want to set a global hook by SetWindowsHookEx. The hook is wrapped in hook.dll and is registered by a GUI window app.exe. Everything works fine on window NT/xp. But on Win7, how could I start app.exe process without UAC prompt and it can successfully load hook.dll to register gloal hook on Win7?? I use VC2005.
Any ideas are appreciated!!
Best whishes,
Kevin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不更改最终用户 UAC 设置(这需要使用键盘或已提升权限并因此看到 UAC 提示),无法执行此操作 。这是设计使然。如果能够执行用户要求出现 UAC 提示而系统却没有出现 UAC 提示的操作,则会被 Microsoft 归类为错误并立即进行修补。
请阅读这篇 MSDN 文章。
Without changing the end users UAC settings (which would require either being at the keyboard or having been elevated and thus having seen a UAC prompt), there is no way to do this. This is by design. Being able to do something that the user has required a UAC prompt be presented for without the system presenting a UAC prompt would be classed as a bug by Microsoft and pretty immediately patched.
Take a read of this MSDN article.