Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Load Monitor Profile if 2 monitors are connected

Description
This script checks to see if there are 2 monitors connected, and if so, it loads the monitor profile that you specify on line 9. You could run this from a "Monitor Profile Changed" Trigger to have the profile automatically load.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Feb 13, 2019
Date Last Modified
Feb 13, 2019

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
        // Set your monitor profile name here
        string profileName = "Monitor Profile Name";
        
        // Gets the number of monitors and if it equals 2, loads the monitor profile	
		int numberOfMonitors = BFS.Monitor.GetMonitorCountEnabledAndDisabled();		
		if (numberOfMonitors == 2)
		{
            BFS.DisplayFusion.LoadMonitorProfile(profileName);
		}
	}
}