Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
CloudShow Manager
DisplayFusion
FileSeek
HashTools
LogFusion
Notepad Replacer
Online Base64 Decoder
Online Base64 Encoder
Online JSON Formatter
ShellSend
TrayStatus
VoiceBot
WallpaperFusion
Window Inspector
More Apps...
DisplayFusion
CheckCentral
CloudShow
ClipboardFusion
FileSeek
TrayStatus
VoiceBot
WallpaperFusion
Display
Fusion
by Binary Fortress Software
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
Features
Free vs Pro
More
Screenshots
Scripted Functions (Macros)
Languages
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Purchase
Login / Register
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Move All Windows to Primary Monitor
Return to DisplayFusion Scripted Functions (Macros)
Description
This script will move all open windows to the Primary monitor.
Language
C#.net
Minimum Version
9.3+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Sep 25, 2018
Date Last Modified
Oct 2, 2018
Scripted Function (Macro) Code
Copy
Select All
using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Get the Primary monitor's ID uint primaryMonitor = BFS.Monitor.GetPrimaryMonitorID(); // Loop through all monitors foreach (uint monitor in BFS.Monitor.GetMonitorIDs()) { // Ignore the Primary monitor if (primaryMonitor != monitor) { // Loop through all windows on the monitor and move them to the Primary monitor foreach (IntPtr window in BFS.Window.GetVisibleAndMinimizedWindowHandles()) { if (BFS.Monitor.GetMonitorIDByWindow(window) != primaryMonitor) BFS.Window.MoveToMonitor(primaryMonitor, window); } } } } }