Processing Ajax...
Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Move all windows on all monitors to the next monitor

Description
This script will shift all windows on each monitor, to the next monitor on the right.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Mar 15, 2022
Date Last Modified
Mar 15, 2022

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		// Get all open windows
		IntPtr[] allWindows = BFS.Window.GetVisibleAndMinimizedWindowHandles();
		
		// Loop through them and move them to the next monitor
		foreach (IntPtr window in allWindows)
		{
			BFS.Window.MoveToNextMonitor(window);	
		}
	}
}