using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Set the Window Position Profile name, window title, application path, and arguments here
string windowPositionProfile = "profile name";
string windowTitle = "*Notepad*";
string appPath = @"C:\Windows\system32\notepad.exe";
string appArgs = "";
// Try to get the window
IntPtr window = BFS.Window.GetWindowByText(windowTitle);
// If the handle is null, launch it and apply the Window Position Profile
if (window == IntPtr.Zero)
{
BFS.Application.Start(appPath, appArgs);
BFS.DisplayFusion.LoadWindowPositionProfile(windowPositionProfile);
}
// Otherwise, give it focus
else
{
BFS.Window.Focus(window);
}
}
}