Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedrolcl/screensaver-disabler
Windows ScreenSaver Disabler
https://github.com/pedrolcl/screensaver-disabler
screensaver-disabler windows winforms
Last synced: 2 months ago
JSON representation
Windows ScreenSaver Disabler
- Host: GitHub
- URL: https://github.com/pedrolcl/screensaver-disabler
- Owner: pedrolcl
- License: bsd-3-clause
- Created: 2020-01-23T08:37:49.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-23T10:59:33.000Z (almost 3 years ago)
- Last Synced: 2023-05-30T22:00:40.292Z (over 1 year ago)
- Topics: screensaver-disabler, windows, winforms
- Language: C#
- Homepage:
- Size: 13.7 KB
- Stars: 21
- Watchers: 2
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Windows ScreenSaver Disabler
Does your organization enforce a policy of password protected screensaver kicking-in
every five minutes, and you can't change it? If so, this utility is for you.Some programs like the Windows Media Player, or PowerPoint in presentation mode
prevent triggering the screensaver. With good reason. But you may be doing
something else like reading documents on the screen while taking hand notes, or
demoing something and you want to prevent the screen-saver-password disruptions.Look to the source code to integrate this functionality in your own applications.
Please take a look to the win32 API function [SetThreadExecutionState](https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate).[FlagsAttribute]
public enum EXECUTION_STATE : uint
{
ES_AWAYMODE_REQUIRED = 0x00000040,
ES_CONTINUOUS = 0x80000000,
ES_DISPLAY_REQUIRED = 0x00000002,
ES_SYSTEM_REQUIRED = 0x00000001
// Legacy flag, should not be used.
// ES_USER_PRESENT = 0x00000004
}[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
This program is written in C# for NET Framework 4.7, and will run in 32 and 64 bit Windows 10 systems.
You may want to try [PowerToys Awake](https://den.dev/blog/powertoys-awake/) as well, which is just another [open source neighbour](https://github.com/microsoft/PowerToys).