using System;
using System.Drawing;
// The 'windowHandle' parameter will contain the window handle for the:
// - Active window when run by hotkey
// - Trigger target when run by a Trigger rule
// - TitleBar Button owner when run by a TitleBar Button
// - Jump List owner when run from a Taskbar Jump List
// - Currently focused window if none of these match
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Get the window dimensions
Rectangle bounds = BFS.Window.GetBounds(windowHandle);
// Calculate the aspect ratio (height divided by width)
double ratio = (double)bounds.Height / bounds.Width;
// Format the ratio to show 2 decimal places
string formattedRatio = ratio.ToString("0.00");
// Create a detailed message with all Rectangle properties and the ratio
string message = "Window Dimensions\n\n" +
"Position: X=" + bounds.X + ", Y=" + bounds.Y + "\n" +
"Size: Width=" + bounds.Width + "px, Height=" + bounds.Height + "px\n" +
"Height/Width Ratio: " + formattedRatio;
// Display dimensions in a message box
BFS.Dialog.ShowMessageInfo(message);
}
}