using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// You can duplicate this script, then change layoutID to something different to save another layout
string layoutID = "Layout1";
IntPtr[] windowHandles = BFS.Window.GetVisibleWindowHandles();
// If the window title is not empty, try to restore its position from the ones saved to the registry using the "Save Window Positions Using Window Title (Layout1)" script
foreach (IntPtr window in windowHandles)
{
string windowTitle = BFS.Window.GetText(window);
if (windowTitle != "")
{
int windowX;
int windowY;
int windowWidth;
int windowHeight;
int.TryParse(BFS.ScriptSettings.ReadValue(windowTitle + "_X_" + layoutID), out windowX);
int.TryParse(BFS.ScriptSettings.ReadValue(windowTitle + "_Y_" + layoutID), out windowY);
int.TryParse(BFS.ScriptSettings.ReadValue(windowTitle + "_Width_" + layoutID), out windowWidth);
int.TryParse(BFS.ScriptSettings.ReadValue(windowTitle + "_Height_" + layoutID), out windowHeight);
if (windowWidth > 0)
{
BFS.Window.SetSizeAndLocation(window, windowX, windowY, windowWidth, windowHeight);
}
}
}
}
}