using System;
using System.Drawing;
// The 'windowHandle' parameter will contain the window handle for the:
// - Active window when run by hotkey
// - Trigger target when run by a Trigger rule
// - TitleBar Button owner when run by a TitleBar Button
// - Jump List owner when run from a Taskbar Jump List
// - Currently focused window if none of these match
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Get the currently focused window
IntPtr window = BFS.Window.GetFocusedWindow();
// Get the screen that the window is currently on
uint currentScreen = BFS.Monitor.GetMonitorIDByWindow(window);
// Check if the window is on Screen 1 or Screen 2 and move accordingly
if (currentScreen == 3)
{
// Keep window to Screen 3
BFS.Window.MoveToMonitor(3, window);
}
if (currentScreen == 1)
{
// Move window to Screen 2
BFS.Window.MoveToMonitor(2, window);
}
else if (currentScreen == 2)
{
// Move window to Screen 1
BFS.Window.MoveToMonitor(1, window);
}
}
}