I am currently attempting to write a Windows Service that will shutdown the computer after a predetermined amount of time of system/user inactivity. In order to do this (at both the logon screen and when logged in) I need to monitor any keyboard event or mouse movement.
I am aware of the "LASTINPUTINFO" method. This only works when the user is logged in.
I am also aware of system level hooks. I can get that to work perfectly in an application but not as a Windows Service.
Do I need to write a driver or something to hook into the WH_KEYBOARD_LL or WH_MOUSE_LL at system level?