Processing Ajax...
Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Open Multiple Websites on Specific Monitors

Description
This script will open the specified websites on their specified monitors. Set the websites and monitor IDs in the websites array on line 9.
Language
C#.net
Minimum Version
Created By
-
Contributors
Keith Lammers (BFS)
Date Created
Mar 11, 2019
Date Last Modified
Mar 11, 2019

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		// Set the websites and their target monitor IDs here
		string[,] websites = {
            { "https://www.displayfusion.com", "2" },
            { "https://www.clipboardfusion.com", "3" }
		};
		
		// Open the websites and move them to their target monitors
		for (int i = 0; i < websites.GetLength(0); i++)
		{
            IntPtr window = BFS.Web.OpenUrlNewWindow(websites[i,0]);
            uint monitorID = Convert.ToUInt32(websites[i,1]);            
            BFS.Window.MoveToMonitorMaximized(monitorID, window);
		}
	}
}