{ "name": "Move Window to Specific Location Depending on Which Monitor It's On", "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\t// Get the monitor that the mouse cursor is on\r\n\t\tuint currentMonitor = BFS.Monitor.GetMonitorIDByXY(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY());\r\n\t\t\r\n\t\t// Setup the locations for the left and right monitors\r\n\t\tRectangle leftMonitorLocation = new Rectangle(-791, 537, 729, 543);\r\n\t\tRectangle rightMonitorLocation = new Rectangle(1982, 537, 729, 543);\r\n\t\t\r\n // Move to the left or right locations based on which monitor the mouse cursor is on\r\n if (currentMonitor == 2)\r\n {\r\n BFS.Window.SetSizeAndLocation(windowHandle, leftMonitorLocation.X, leftMonitorLocation.Y, leftMonitorLocation.Width, leftMonitorLocation.Height);\r\n }\r\n else if (currentMonitor == 3)\r\n {\r\n BFS.Window.SetSizeAndLocation(windowHandle, rightMonitorLocation.X, rightMonitorLocation.Y, rightMonitorLocation.Width, rightMonitorLocation.Height);\r\n }\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" }