using System; using System.Drawing; // The 'windowHandle' parameter will contain the window handle for the: // - Active window when run by hotkey // - Window Location target when run by a Window Location 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 width from the user string widthPercent = BFS.Dialog.GetUserInput("The width of the window in percent:", ""); //if the user entered nothing or pressed cancel, if(string.IsNullOrEmpty(widthPercent)) return; string heightPercent = BFS.Dialog.GetUserInput("The height of the window in percent:", ""); if(string.IsNullOrEmpty(heightPercent)) return; Rectangle monitorBounds = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle); try { BFS.Window.SetSize(windowHandle, (int)(monitorBounds.Width * (Convert.ToInt32(widthPercent) / 100m)), (int)(monitorBounds.Height * (Convert.ToInt32(heightPercent) / 100m))); } catch { } } }