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 style of the window BFS.WindowEnum.WindowStyle style = BFS.Window.GetWindowStyle(windowHandle); //the window doesn't have WS_DLGFRAME, add the style, restore the window, then exit the script if((style & BFS.WindowEnum.WindowStyle.WS_DLGFRAME) == 0) { BFS.Window.SetWindowStyle(style | BFS.WindowEnum.WindowStyle.WS_DLGFRAME, windowHandle); BFS.Window.Restore(windowHandle); return; } //if we got this far, that means that we have the style. remove the style BFS.Window.SetWindowStyle(style & ~BFS.WindowEnum.WindowStyle.WS_DLGFRAME, windowHandle); //maximize the window BFS.Window.Maximize(windowHandle); } }