Search code examples
c#desktop-applicationmousekeyhook

Global hook mousedown and keypress events are not firing


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.


Solution

  • 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