Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn off screensavers. Note that this won't work on Vista+ when there…
…'s a password.
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0ccebac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have code somewhere to disable the screen saver and sleep (also on Vista and higher when there is a password) ...
Right, here it is:
You just put one instance of that on the stack in main -- at least that's what I do in another project. The SystemParametersInfo stuff is somewhat bad practice, but I don't know of a reliable method which is good practice -- you'd expect SetThreadExecutionState(ES_DISPLAY_REQUIRED ...) to disable the screensaver, but it doesn't, it only disables turning off the screen for power saving.
0ccebac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bogus mouse event option in this program keeps the screensaver off, laptop screen dimming off, and hibernation off when you have a password on. Maybe you can check the source code to see how to implement.
http://code.google.com/p/magical-tools/downloads/detail?name=Insomnia%20r116.zip&can=2&q=
It is also implemented in this plugin when prevent screensaver is checked:
http://code.google.com/p/magical-tools/downloads/detail?name=Pokopom%20r127.zip&can=2&q=