Skip to content

fernandofig/screensaver-disabler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

    [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 as well, which is just another open source neighbour.

About

Windows ScreenSaver Disabler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%