Global hook mousedown and keypress events are not firing

青春壹個敷衍的年華 提交于 2019-12-10 18:47:37

问题


I've used the exact same code in my c# desktop application as it is given in here : https://github.com/gmamaladze/globalmousekeyhook

It works and fires the mousedown and keypress events as long as the application is in focus. If i'm on another application, let'say on visual studio (while mousekey logger is running), it doesn't fire the events.

Is it correct behavior? If so, any help to achieve this would be appreciated.


回答1:


As suggested by @Hans Passant, application must be run in elevated mode if we have to track activity in other elevated applications. Running the ClickOnce application in Elevated mode was not so easy, i used this trick to achieve it. http://antscode.blogspot.com.au/2011/02/running-clickonce-application-as.html



来源:https://stackoverflow.com/questions/30326187/global-hook-mousedown-and-keypress-events-are-not-firing

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