简体   繁体   中英

How do I subvert computer idle detection on Windows?

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?

您正在寻找SendInput函数

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:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM