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?

User Image
DarkKnight777
9 discussion posts
Hey Ya'll ive been using display fusion to mirror a window to another monitor in this case its been full screen boarderless games. but the issue im having is the redbox indicator only goes to the top of where the taskbar would be and since the game is in full screen boarderless windowed mode the game utilizes the full screen and not only to the top of the task bar. I was wondering if there was a way to either change the diementions of the red indicator box or make it disappear all together.
May 26, 2025  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Which mirror function are you using?
May 27, 2025  • #2
User Image
DarkKnight777
9 discussion posts
Quote:
Which mirror function are you using?


Good Morning Owen! I am using the Mirror Window (no border) function if I recall correctly (currently at work so i can't look over all the C# code otherwise I would paste it right now) I need the Window Mirror over the monitor Mirror due to needing to capture one only one window to send it over to a capture card, ive got that entire thing working its mainly just the Red Box to indicate what window is being mirrored that is causing an issue. I wasnt sure if there was something in the settings that I was missing where a person could either manually set the dimensions or a way to disable the indicator box all together. If none of this information helps let me know and when i get home Ill send over the C# Code later today.

As a side note what I do find funny is that although the redbox stops at the top of the task bar (or where the task bar would be when running a game in boarderless windowed mode), it fully captures the game. I just get the redline going through the bottom of the game up to where the task bar would be even though the task bar isnt present when the game is open.
May 27, 2025  • #3
User Image
DarkKnight777
9 discussion posts
Quote:
Which mirror function are you using?


Yep it looks like I am Mirroring the window, The Script i am using is below

using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using System.Drawing;

public static class DisplayFusionFunction
{
// -----------------------------------------------------------
// P/Invoke declarations for window manipulation
// -----------------------------------------------------------

[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();

[DllImport("user32.dll")]
private static extern IntPtr GetAncestor(IntPtr hwnd, uint gaFlags);
private const uint GA_ROOT = 2;

[DllImport("user32.dll")]
private static extern bool IsWindowVisible(IntPtr hWnd);

[DllImport("user32.dll", SetLastError = true)]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);

[DllImport("user32.dll", SetLastError = true)]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
private const int GWL_STYLE = -16;
private const int GWL_EXSTYLE = -20;

[DllImport("user32.dll", SetLastError = true)]
private static extern bool SetWindowPos(
IntPtr hWnd,
IntPtr hWndInsertAfter,
int X, int Y, int cx, int cy,
uint uFlags);

// Standard window style constants.
private const int WS_BORDER = 0x00800000;
private const int WS_DLGFRAME = 0x00400000;
private const int WS_CAPTION = WS_BORDER | WS_DLGFRAME;
private const int WS_THICKFRAME = 0x00040000;
private const int WS_POPUP = unchecked((int)0x80000000);
private const int WS_VISIBLE = 0x10000000;

// Extended window style constants.
private const int WS_EX_NOACTIVATE = 0x08000000;
private const int WS_EX_TOOLWINDOW = 0x00000080;

// SetWindowPos flags.
private const uint SWP_NOMOVE = 0x0002;
private const uint SWP_NOSIZE = 0x0001;
private const uint SWP_NOZORDER = 0x0004;
private const uint SWP_FRAMECHANGED= 0x0020;
private const uint SWP_SHOWWINDOW = 0x0040;

public static void Run()
{
try
{
// -----------------------------------------------------------
// STEP 1: Immediately store the active (target) window handle.
// This ensures we capture the desired window, not a previous one.
// -----------------------------------------------------------
IntPtr targetWindow = GetForegroundWindow();
if (targetWindow == IntPtr.Zero || !IsWindowVisible(targetWindow))
{
MessageBox.Show("No valid window in the foreground.", "Mirror Error");
return;
}

// -----------------------------------------------------------
// STEP 2: Close any existing mirror windows.
// -----------------------------------------------------------
IntPtr[] oldMirrors = BFS.Window.GetWindowsByText("*mirror window*");
if (oldMirrors != null)
{
foreach (IntPtr m in oldMirrors)
{
if (m != IntPtr.Zero)
BFS.Window.Close(m);
}
}
for (int i = 0; i < 10; i++)
{
IntPtr[] check = BFS.Window.GetWindowsByText("*mirror window*");
if (check == null || check.Length == 0)
break;
Thread.Sleep(50);
}
Thread.Sleep(500);

// -----------------------------------------------------------
// STEP 3: Create the mirror by mirroring the stored target window.
// -----------------------------------------------------------
BFS.DisplayFusion.MirrorWindow(targetWindow);
Thread.Sleep(300);

// -----------------------------------------------------------
// STEP 4: Retrieve the new mirror window.
// -----------------------------------------------------------
IntPtr[] newMirrors = BFS.Window.GetWindowsByText("*mirror window*");
if (newMirrors == null || newMirrors.Length == 0)
{
MessageBox.Show("Mirror window not found.", "Mirror Error");
return;
}
IntPtr mirrorHandle = newMirrors[0];

// -----------------------------------------------------------
// STEP 5: Remove borders and adjust window style.
// Also add extended styles to keep it non-activating.
// -----------------------------------------------------------
int style = GetWindowLong(mirrorHandle, GWL_STYLE);
int newStyle = style & ~(WS_CAPTION | WS_THICKFRAME);
newStyle |= WS_POPUP | WS_VISIBLE;
SetWindowLong(mirrorHandle, GWL_STYLE, newStyle);
SetWindowPos(mirrorHandle, IntPtr.Zero, 0, 0, 0, 0,
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);

int exStyle = GetWindowLong(mirrorHandle, GWL_EXSTYLE);
exStyle |= WS_EX_NOACTIVATE | WS_EX_TOOLWINDOW;
SetWindowLong(mirrorHandle, GWL_EXSTYLE, exStyle);

// -----------------------------------------------------------
// STEP 6: Force the mirror window onto monitor 3.
// (This uses DisplayFusion’s built-in function to reposition
// and maximize the mirror window on monitor 3.)
// -----------------------------------------------------------
Screen[] screens = Screen.AllScreens;
if (screens.Length < 3)
{
MessageBox.Show("Monitor 3 not found.", "Mirror Error");
return;
}
BFS.Window.MoveToMonitorMaximized(3, mirrorHandle);
}
catch (Exception ex)
{
MessageBox.Show("An error occurred: " + ex.Message, "Mirror Error");
}
}
}
May 27, 2025  • #4
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Strange, I can't seem to reproduce that here. If you just run the mirror function manually without your script, does the same thing happen?
May 28, 2025  • #5
User Image
DarkKnight777
9 discussion posts
Quote:
Strange, I can't seem to reproduce that here. If you just run the mirror function manually without your script, does the same thing happen?


Hey Owen, I just tried using the built in mirror function on a full screen borderless windowed mode game I have attached a picture as an example of what I am seeing. As you can see at the bottom where the abilities and the chat box are there is the red line to show what is being captured which is just enough space from the bottom of the screen where the task bar would originally be. Attached is a picture.
• Attachment [protected]: Redline Display Fusion.png [16,972,013 bytes]
May 28, 2025 (modified May 28, 2025)  • #6
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Thanks for sending that over, I'll download Guild Wars here and test it out.

Does it happen with any other games?
29 days ago  • #7
User Image
DarkKnight777
9 discussion posts
Quote:
Thanks for sending that over, I'll download Guild Wars here and test it out.

Does it happen with any other games?


Well I can see why you said it wasnt replicating on your end at first, looks like it works with a lot of the other games I play regularly, the other game I play regularly where ive found this exact issue is Final Fantasy 14, I just tested it on about 10-15 other games and it looks like it works fine on those. But the 2 mmorpgs that I play is where I experience the issue found in the screenshot I posted earlier.
29 days ago  • #8
User Image
DarkKnight777
9 discussion posts
Quote:
Thanks for sending that over, I'll download Guild Wars here and test it out.

Does it happen with any other games?


So I did end up finding a work around (not ideal but it works) by using an additional software (borderless gaming) and putting the games in flat out windowed mode and then using the borderless gaming software to make it full screen borderless. After doing it and using Display Fusion to mirror it seems to have worked. I dont really know why this works opposed to just putting those 2 games just in borderless windowed mode within the game settings. But its at least a temporary solution!
29 days ago (modified 28 days ago)  • #9
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
That's really odd, I tested it here and I still can't seem to reproduce it. Could you send me a copy of your troubleshooting info? Here are the steps:
 
  • Open the DisplayFusion Settings > Troubleshooting tab
  • Click the "Export Info to File" button
  • Reply with the file attached
25 days ago  • #10
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)