{ "name": "Cycle Left to Right", "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\t\tRectangle[] monitorBounds = BFS.Monitor.GetMonitorBoundsNoSplits();\r\n\t\tuint monitorID = BFS.Monitor.GetMonitorIDByWindow(windowHandle);\r\n\t\t\r\n\t\t// Setup the bounds for the left half and right half of the screen (ignoring splits)\r\n\t\tRectangle leftHalf = new Rectangle(monitorBounds[0].X, monitorBounds[0].Y, monitorBounds[0].Width / 2, BFS.Monitor.GetMonitorWorkAreaByWindow(windowHandle).Height);\r\n\t\tRectangle rightHalf = new Rectangle(monitorBounds[0].Width / 2, monitorBounds[0].Y, monitorBounds[0].Width / 2, BFS.Monitor.GetMonitorWorkAreaByWindow(windowHandle).Height);\r\n\t\t\r\n\t\t// If maximized to the left split, resize to the left half (ignore splits)\r\n\t\tif (monitorID == 101 && BFS.Window.GetBounds(windowHandle) != leftHalf)\r\n\t\t{\r\n BFS.Window.SetSizeAndLocation(windowHandle, leftHalf.X, leftHalf.Y, leftHalf.Width, leftHalf.Height);\r\n\t\t}\r\n\t\t// If sized to the left half, size to the right half (ignore splits)\r\n\t\telse if (BFS.Window.GetBounds(windowHandle) == leftHalf)\r\n\t\t{\r\n BFS.Window.SetSizeAndLocation(windowHandle, rightHalf.X, rightHalf.Y, rightHalf.Width, rightHalf.Height);\r\n\t\t}\r\n\t\t// If sized to the right half, or anywhere else, move it to the right split and maximize\r\n\t\telse\r\n\t\t{\r\n BFS.Window.MoveToMonitorMaximized(103, windowHandle);\r\n\t\t}\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" }