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?
Save up to 33% on our desktop apps during our big Black Friday/Cyber Monday sale!Save up to 33% on our desktop apps during our big Black Friday/Cyber Monday sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save up to 33% on our desktop apps during our big Black Friday/Cyber Monday sale!

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
Jul 3, 2026
Date Last Modified
Jul 3, 2026

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);
	}
}