Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Toggle Screen Saver Timeout Between 1 and 20 minutes

Description
Each time you run this script it will toggle the screen saver timeout between 1 and 20 minutes.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Jan 13, 2020
Date Last Modified
Jan 13, 2020

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
        // Set the timeouts you want to toggle between here
        int timeout1 = 1;
        int timeout2 = 20;

		// Get the current timeout
		int currentTimeout = BFS.ScreenSaver.GetTimeoutMinutes();
		
		// Set the new timeout
		if (currentTimeout == timeout1)
            BFS.ScreenSaver.SetTimeoutMinutes(timeout2);
        else
            BFS.ScreenSaver.SetTimeoutMinutes(timeout1);
	}
}