Click here to Skip to main content
15,884,075 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Regarding the very helpful article ...

Processing Global Mouse and Keyboard Hooks in C#
(Processing Global Mouse and Keyboard Hooks in C#[^])

... I need to run the HookManager in a windows service, but the events will not firing ... any ideas?

What I have tried:

It runs perfect in a WinForm-Application
Posted
Updated 4-Mar-19 8:27am

1 solution

You won't get this working as services have their own separate desktop\user session from the logged in user so your service code can't access anything on the interactive desktop such as mouse and keyboard events. It works fine from your application as your application is running as your interactive user in the same user session.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900