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 2 Windows Explorer Windows on Monitor 2

Description
This script will open two Windows Explorer windows on monitor 2, and position them on the left and right half of the monitor.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Apr 13, 2015
Date Last Modified
Jul 5, 2016

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run()
	{
		//Open the first Explorer instance and move it to the left half of monitor 2
		BFS.Application.Start("C:\\Windows\\explorer.exe", "%DOCUMENTS%");
		BFS.General.ThreadWait(1000);
		IntPtr windowHandle = BFS.Window.GetFocusedWindow();
		BFS.Window.MoveToMonitor(2, windowHandle);
		BFS.General.ThreadWait(250);
		BFS.DisplayFusion.RunFunctionWithWindowHandle("Size and Move Window to Left Side of Monitor", windowHandle);

		//Open the first Explorer instance and move it to the right half of monitor 2
		BFS.Application.Start("C:\\Windows\\explorer.exe", "%DOCUMENTS%");
		BFS.General.ThreadWait(1000);
		windowHandle = BFS.Window.GetFocusedWindow();
		BFS.Window.MoveToMonitor(2, windowHandle);
		BFS.General.ThreadWait(250);	
		BFS.DisplayFusion.RunFunctionWithWindowHandle("Size and Move Window to Right Side of Monitor", windowHandle);
	}
}