using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Set the URLs for each browser window here string[] browser1URLs = { "https://www.displayfusion.com", "https://www.clipboardfusion.com" }; string[] browser2URLs = { "https://www.fileseek.ca", "https://www.voicebot.net" }; string[] browser3URLs = { "https://www.traystatus.com", "https://www.logfusion.ca" }; string[] browser4URLs = { "https://www.google.com", "https://www.bing.com" }; string[] browser5URLs = { "https://www.yahoo.com" }; // Set the target monitor ID here for the split windows uint monitorIDSplit = 3; // Set the target monitor IDs here for the maximized windows uint monitorIDMaximized1 = 1; uint monitorIDMaximized2 = 2; // Get the monitor work area for the target monitor Rectangle monitorWorkArea = BFS.Monitor.GetMonitorWorkAreaByID(monitorIDSplit); // Launch split browser window 1 string browser1Parameters = "--new-window "; foreach (string URL in browser1URLs) { browser1Parameters = browser1Parameters + URL + " "; } BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", browser1Parameters); BFS.General.ThreadWait(1000); BFS.Window.MoveToMonitor(monitorIDSplit, BFS.Window.GetFocusedWindow()); BFS.Window.SetSizeAndLocation(BFS.Window.GetFocusedWindow(), monitorWorkArea.X, monitorWorkArea.Y, (int)(monitorWorkArea.Width * 0.44), monitorWorkArea.Height / 2); // Launch split browser window 2 string browser2Parameters = "--new-window "; foreach (string URL in browser2URLs) { browser2Parameters = browser2Parameters + URL + " "; } BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", browser2Parameters); BFS.General.ThreadWait(1000); BFS.Window.MoveToMonitor(monitorIDSplit, BFS.Window.GetFocusedWindow()); BFS.Window.SetSizeAndLocation(BFS.Window.GetFocusedWindow(), (int)(monitorWorkArea.X + monitorWorkArea.Width * 0.44), monitorWorkArea.Y, (int)(monitorWorkArea.Width * 0.56), monitorWorkArea.Height / 2); // Launch split browser window 3 string browser3Parameters = "--new-window "; foreach (string URL in browser3URLs) { browser3Parameters = browser3Parameters + URL + " "; } BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", browser3Parameters); BFS.General.ThreadWait(1000); BFS.Window.MoveToMonitor(monitorIDSplit, BFS.Window.GetFocusedWindow()); BFS.Window.SetSizeAndLocation(BFS.Window.GetFocusedWindow(), monitorWorkArea.X, monitorWorkArea.Y + monitorWorkArea.Height / 2, monitorWorkArea.Width, monitorWorkArea.Height / 2); // Launch maximized browser window 1 string browser4Parameters = "--new-window "; foreach (string URL in browser4URLs) { browser4Parameters = browser4Parameters + URL + " "; } BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", browser4Parameters); BFS.General.ThreadWait(1000); BFS.Window.MoveToMonitorMaximized(monitorIDMaximized1, BFS.Window.GetFocusedWindow()); // Launch maximized browser window 2 string browser5Parameters = "--new-window "; foreach (string URL in browser5URLs) { browser5Parameters = browser5Parameters + URL + " "; } BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", browser5Parameters); BFS.General.ThreadWait(1000); BFS.Window.MoveToMonitorMaximized(monitorIDMaximized2, BFS.Window.GetFocusedWindow()); } }