using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Check to see if there was an error, if there was, exit the function
if (windowHandle == IntPtr.Zero)
return;
// Get the position of the window in the monitor, and the current monitor
Rectangle windowRect = BFS.Window.GetBounds(windowHandle);
Rectangle monitorRect = BFS.Monitor.GetMonitorWorkAreaByWindow(windowHandle);
int iFinalWinX = monitorRect.X;
int iFinalWinY = monitorRect.Y;
// Calculate 75% of the monitor's width
int iFinalWinW = (int)(monitorRect.Width * 0.75);
int iFinalWinH = monitorRect.Height;
// Determine if the window is currently positioned on the left or right side
if (windowRect.X == iFinalWinX && windowRect.Width == iFinalWinW)
{
// If on the left 75%, move it to the right 75%
iFinalWinX = monitorRect.X + monitorRect.Width - iFinalWinW;
}
else
{
// Otherwise, move it to the left 75%
iFinalWinX = monitorRect.X;
}
BFS.Window.SetSizeAndLocation(windowHandle, iFinalWinX, iFinalWinY, iFinalWinW, iFinalWinH);
}
}