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?

Confirm

Are you sure?

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