通过clickedonce安装的Windows应用程序可以设置键盘钩子和鼠标钩子吗
我的 C# 应用程序使用鼠标和键盘挂钩,如下所述:
http://www.codeproject.com /KB/cs/globalhook.aspx
有人可以告诉我是否能够使用“ClickOnce”安装我的应用程序,如下所述:
http://msdn.microsoft.com/en-us/library/142dbbz4(v=vs.80).aspx
恐怕诸如“设置挂钩”之类的事情不属于
授予的安全权限范围:“仅授予应用程序所需的权限(更安全)”
My C# application uses Mouse and Keyboard Hooks as described here:
http://www.codeproject.com/KB/cs/globalhook.aspx
Can somebody tell me whether I will be able to install my application using "ClickOnce" as described here:
http://msdn.microsoft.com/en-us/library/142dbbz4(v=vs.80).aspx
I am afraid that a thing such as "setting a hook" is not covered by
Security permissions granted: "Grants only permissions necessary for the application (more safe)"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以设置挂钩,但您有权访问的窗口将根据 UAC 级别而有所不同。如果您的应用程序以普通用户身份运行,则您的挂钩将仅适用于其他常规应用程序(即不以管理员身份运行)。如果您的应用程序以管理员身份运行,那么您的挂钩将与所有其他应用程序一起使用。
根据 这篇 MSDN 文章,ClickOnce 应用程序无法以管理员身份运行,因此这意味着您的挂钩将受到一定程度的限制,但这应该不是什么太大的问题,因为大多数应用程序都在非管理员模式下运行。找出答案的最佳方法是亲自测试部署。
You can always set a hook, but the windows that you have access to will vary depending on the UAC level. If your application is running as a regular user, your hook will only work with other regular applications (i.e. not running as administrator). If your application is run as administrator, then your hook will work with all other applications.
According to this MSDN article, ClickOnce applications cannot be run as administrator, so that would mean your hooks will be somewhat limited, though this shouldn't be too much of a problem since most apps run in non-administrator mode. The best way to figure out would be to test the deployment yourself.