using System;
using System.Drawing;
// The 'windowHandle' parameter will contain the window handle for the:
// - Active window when run by hotkey
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// see if Calc is already running
uint appId = BFS.Application.GetAppIDByFile("*calc.exe");
// if we couldn't get the Calc window, start it
if (appId == 0)
appId = BFS.Application.Start("calc.exe", "");
// get the window handle
IntPtr calcWindow = BFS.Application.GetMainWindowByAppID(appId);
// if the app is minimized, restore it
if (BFS.Window.IsMinimized(calcWindow))
BFS.Window.Restore(calcWindow);
//move the window to Monitor 3 and give it focus
BFS.Window.MoveToMonitor(3, calcWindow);
BFS.Window.Focus(calcWindow);
}
}