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;
}
}
}
}
}