Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

A recent AVG and Avast antivirus update is preventing DisplayFusion 9.9 from launching on some systems.
If you're running into this issue, please update to the latest DisplayFusion 10.0 Beta.

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);
	}
}