Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Open Multiple Chrome Windows with Multiple Tabs on Specific Monitors

Description
This script will open multiple tabs in each Chrome window and maximize them on monitors 1, 2, 3, and 4.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Mar 12, 2019
Date Last Modified
Mar 12, 2019

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
        // Set the websites for monitor 1 here
        string[] websitesMonitor1 = { 
            "https://www.displayfusion.com",
            "https://www.clipboardfusion.com",
            "https://www.checkcentral.cc"
        };
        
        // Set the websites for monitor 2 here
        string[] websitesMonitor2 = { 
            "https://www.displayfusion.com",
            "https://www.clipboardfusion.com",
            "https://www.checkcentral.cc"
        };
        
        // Set the websites for monitor 3 here
        string[] websitesMonitor3 = { 
            "https://www.displayfusion.com",
            "https://www.clipboardfusion.com",
            "https://www.checkcentral.cc"
        };
        
        // Set the websites for monitor 4 here
        string[] websitesMonitor4 = { 
            "https://www.displayfusion.com",
            "https://www.clipboardfusion.com",
            "https://www.checkcentral.cc"
        };
        
        // Launch and move the browser windows
        LaunchAndMoveBrowser(1, websitesMonitor1);
        LaunchAndMoveBrowser(2, websitesMonitor2);
        LaunchAndMoveBrowser(3, websitesMonitor3);
        LaunchAndMoveBrowser(4, websitesMonitor4);

	}
	
	private static void LaunchAndMoveBrowser(uint monitorID, string[] websites)
	{
        // Build the command-line arguments
        string args = string.Join(" ", websites, 0, websites.Length);
        args += " --new-window";
        
        // Launch the browser
        BFS.Application.Start(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", args);
        BFS.General.ThreadWait(2000);
        
        // Move the window
        BFS.Window.MoveToMonitorMaximized(monitorID, BFS.Window.GetFocusedWindow());
	}
}