{ "name": "Resize Window Depending on Screen Resolution", "language": 0, "code": "using System;\r\nusing System.Drawing;\r\n\r\n// The 'windowHandle' parameter will contain the window handle for the:\r\n// - Active window when run by hotkey\r\n// - Trigger target when run by a Trigger rule\r\n// - TitleBar Button owner when run by a TitleBar Button\r\n// - Jump List owner when run from a Taskbar Jump List\r\n// - Currently focused window if none of these match\r\npublic static class DisplayFusionFunction\r\n{\r\n\tpublic static void Run(IntPtr windowHandle)\r\n\t{\r\n // Gets the monitor bounds\r\n\t\tRectangle monitorBounds = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle);\r\n\t\t\r\n\t\t// If the monitor is 3840 wide, set the window to 65% x 85%\r\n\t\tif (monitorBounds.Width == 3840)\r\n BFS.Window.SetSize(windowHandle, Convert.ToInt32(monitorBounds.Width * 0.65), Convert.ToInt32(monitorBounds.Height * 0.85));\r\n // If the monitor is 3440 wide, set the window to 50% x 70%\r\n else if (monitorBounds.Width == 3440)\r\n BFS.Window.SetSize(windowHandle, Convert.ToInt32(monitorBounds.Width * 0.5), Convert.ToInt32(monitorBounds.Height * 0.7));\r\n\t}\r\n}", "description": "", "references": "System.Core.dll | System.Data.dll | System.dll | System.Drawing.dll | System.Management.dll | System.Web.dll | System.Windows.Forms.dll | System.Xml.dll" }