Reputation: 170499
In order to detect user absence GetLastInputInfo()
can be used.
I want to make GetLastInputInfo()
return that I've just used keyboard/mouse all the time - as I've been actively using the computer so that whoever relies on GetLastInputInfo()
thinks I'm actively using the computer.
Can I use any Windows API functions to achieve that?
Upvotes: 2
Views: 486
Reputation: 72658
What is this for? Do you just want to disable the screensaver? If that's the case, then you're probably better off looking at the SetThreadExecutionState function.
Upvotes: 2
Reputation: 101616
Have you tried to simply move the mouse up and down a bit (15 pixels or so) with SendInput()?. I can't remember if NT6+ only resets the timeout for real hardware input or not.
The other options are:
Upvotes: 2