Login / Register
▼
Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
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
VoiceBot
WallpaperFusion
Home
▼
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
▼
Features
Features
Incredible Desktop Wallpaper
Monitor Configuration
Monitor Splitting
Powerful Functions
Triggers
Multi-Monitor Taskbars
Useful Windows 10 Tweaks
Useful Windows 8 Tweaks
Windows Lock Screen
Multi-Monitor Screen Savers
Monitor Fading
Window Snapping
Window Management
Mouse Management
Alt+Tab Handler
Window Position Profiles
Desktop Icon Profiles
Remote Control
Available in dozens of Languages
Easy Administration
Free vs Pro
Purchase
Screenshots
Languages
▼
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Scripted Functions (Macros)
Display
Fusion
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Cascade Windows on Current Monitor
Return to DisplayFusion Scripted Functions (Macros)
Description
This script will cascade all of the windows on the current monitor.
Language
C# (.Net)
Minimum Version
9.6.1+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Apr 9, 2020
Date Last Modified
Apr 9, 2020
Scripted Function (Macro) Code
Copy
Select All
Toggle Line Wrapping
using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Get the current monitor ID uint monitorID = BFS.Monitor.GetMonitorIDByXY(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY()); // Get all visible and minimized windows IntPtr[] windows = BFS.Window.GetVisibleAndMinimizedWindowHandles(); // Get the monitor bounds Rectangle monitorBounds = BFS.Monitor.GetMonitorBoundsByID(monitorID); // Set the starting position for the first window in the cascade int x = monitorBounds.X; int y = monitorBounds.Y; // Loop through the windows, if they're on the current monitor, cascade them foreach (IntPtr window in windows) { if (BFS.Monitor.GetMonitorIDByWindow(window) == monitorID) { // Ignore windows that have a blank window title if (!(BFS.Window.GetText(window) == "")) { // Move the window and size it to 75% width/height BFS.Window.SetSizeAndLocation(window, x, y, Convert.ToInt32(monitorBounds.Width * 0.75), Convert.ToInt32(monitorBounds.Height * 0.75)); // Increment the x,y values for the next window in the loop x = x + 10; y = y + 10; } } } } }
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch