Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

Move All Windows from Monitor 2 to the Current Monitor

Description
This script will move all visible windows from monitor 2 to the monitor that the mouse cursor is currently on.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Dec 22, 2017
Date Last Modified
Dec 22, 2017

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
        // Set the Monitor ID you want to move the windows from
        uint monitorID = 2;

        // Loop through the visible windows on the monitor and move them to the monitor that has the mouse cursor
        foreach (IntPtr window in BFS.Window.GetVisibleWindowHandlesByMonitor(monitorID))
        {
            BFS.DisplayFusion.RunFunctionWithWindowHandle("Move Window to Current Monitor", window);
        }   
	}
}