Is there a recommended way to prevent the Windows screensaver from starting? The closest thing I've found is this article, but what I would really like to do is just tell Windows that the computer isn't idle rather than fooling with the currently set screensaver values.
相关问题
- the application was unable to start correctly 0xc0
- Handle button click in another application
- win32 Python - pythoncom error - ImportError: No m
- How to prevent windows from accessing and detectin
- Getting the output from a process created by Creat
相关文章
- Why windows 64 still makes use of user32.dll etc?
- How do I get to see DbgPrint output from my kernel
- Can WM_NEXTDLGCTL be used with non-dialog windows?
- Windows EventLog: How fast are operations with it?
- Are resource files compiled as UNICODE or ANSI cod
- How can one batch file get the exit code of anothe
- user32 and kernel method list for C# [closed]
- Writing to the middle of the file (without ove
Subtle. The official way to tell Windows that the system is not idle is SetThreadExecutionState. This resets the idle timer, (or turns it off, if you pass
ES_CONTINUOUS
). However, even though SetThreadExecutionState resets the idle timer, it does not stop the screensaver!This blog post details what you need to do in C++.
The actual code snippet from the website:
}
I use Mouse Jiggler to reset the idle state. This gets around a Group Policy that tends to start my screensaver (and lock the machine) at inopportune times: when I'm reading a long document, studying a complex chunk of code, or talking/listening/not-constantly-typing during a meeting.
As it can be slightly annoying to have the mouse jump 1px diagonally every second, I intend to use AutoHotKey to write a script that does basically the same thing, but only after a configured keyboard/mouse idle timeout, and maybe use the Shift key (or Scroll Lock) instead of a mouse move.
From MSDN:
There's a caveat though:
That seems to apply even if you use the SetThreadExecutionState with ES_CONTINUOUS.
So, if it weren't for the caveat, your choices would be:
The last option is nice in that it works even with the password protection policy.