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.

Prompt for Window Position Profile

Description
This script will show a list of all of your Window Position Profiles, and allow you to select one to load.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Mar 4, 2020
Date Last Modified
Mar 24, 2020

Scripted Function (Macro) Code

using System;
using System.Drawing;
using System.Collections.Generic;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		// Get the list of all functions
		string[] allFunctions = BFS.DisplayFusion.GetFunctions();
		
		// Build a new list with only the Window Position Profile functions
		List<string> wppFunctions = new List<string>();
		
		foreach (string function in allFunctions)
		{
            if (function.Contains("Load Window Position Profile"))
            {
                string wppName = function.Replace("Load Window Position Profile: ", "");
                wppFunctions.Add(wppName);
            }
		}
		
		// Show the list so the user can choose one
		string selectedProfile = "Load Window Position Profile: " + BFS.Dialog.GetUserInputListViewWithFilter("Choose the Window Position Profile to load", wppFunctions.ToArray());
		//BFS.Dialog.ShowMessageInfo(selectedProfile);
		
		// Load the selected profile
		BFS.DisplayFusion.RunFunction(selectedProfile);
	}
}