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?

Confirm

Are you sure?

Make Window Borderless Fullscreen 16:9

Description
This Scripted Function will set the window to the full monitor height, then set the width to make the window a 16:9 ratio, and remove the window borders.
Language
C#.net
Minimum Version
Created By
Katay
Contributors
-
Date Created
8h ago
Date Last Modified
8h ago

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		if (windowHandle == IntPtr.Zero) return;

		Rectangle monitorBounds = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle);

		int targetHeight = monitorBounds.Height;
		int targetWidth = (targetHeight * 16) / 9;

		int x = monitorBounds.X + ((monitorBounds.Width - targetWidth) / 2);
		int y = monitorBounds.Y;

		BFS.WindowEnum.WindowStyle style = BFS.Window.GetWindowStyle(windowHandle);
		style &= ~BFS.WindowEnum.WindowStyle.WS_CAPTION;
		style &= ~BFS.WindowEnum.WindowStyle.WS_SYSMENU;
		style &= ~BFS.WindowEnum.WindowStyle.WS_THICKFRAME__SIZEBOX;
		style &= ~BFS.WindowEnum.WindowStyle.WS_MINIMIZEBOX;
		style &= ~BFS.WindowEnum.WindowStyle.WS_MAXIMIZEBOX;

		BFS.Window.SetWindowStyle(style, windowHandle);

		BFS.Window.SetSizeAndLocation(windowHandle, x, y, targetWidth, targetHeight);
	}
}