using System; using System.Drawing; // This script should be automatically run when switchting windows profiles. // It is meant for dual screen setups where the main work monitor is recognized // as display 2. If apps are moved to display 1 upon profile change, it should // send them back to display 2. public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // get visible window handles IntPtr[] handles = BFS.Window.GetVisibleWindowHandles(); bool allMonitors = BFS.Monitor.GetMonitorBoundsByID(1) != Rectangle.Empty && BFS.Monitor.GetMonitorBoundsByID(2) != Rectangle.Empty; bool oneMonitor = BFS.Monitor.GetMonitorBoundsByID(1) != Rectangle.Empty; if(allMonitors) for (int i = 0; i < handles.Length; i++) BFS.Window.MoveToMonitor(2, handles[i]); else if(oneMonitor) for (int i = 0; i < handles.Length; i++) BFS.Window.MoveToMonitor(1, handles[i]); } }