Feature Request: Black Bar UltraWide Support #174
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound#174
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Iupin on GitHub · 2026-11-30 20:03 UTC · original
Can we add black bars for those with Ultra Wides so we can full screen without a stretched image?
@FoxNineOne on GitHub · 2026-11-30 23:59 UTC · original · edited 2026-12-01 00:04 UTC
This is an amended fullscreen.ps1
Run the game in windowed mode, then when it loads up, run this.
Working for me (only tested for 5 minutes though)
(I haven't commented on Github before, it seems the markdown is messing up formatting of the code.. so I've attached it too!)
fullscreen.ps1.txt
`# Makes the running game's window borderless and the size of its monitor (borderless full screen). Waits up to
3 minutes for the window. The game itself is not touched otherwise.
.\fullscreen.ps1
Add-Type @'
using System;
using System.Runtime.InteropServices;
public static class FullWin {
[StructLayout(LayoutKind.Sequential)] public struct RECT { public int Left, Top, Right, Bottom; }
[StructLayout(LayoutKind.Sequential)] public struct MONITORINFO { public int cbSize; public RECT rcMonitor, rcWork; public uint dwFlags; }
[DllImport("user32.dll")] public static extern bool SetProcessDPIAware();
[DllImport("user32.dll")] public static extern IntPtr MonitorFromWindow(IntPtr h, uint flags);
[DllImport("user32.dll")] public static extern bool GetMonitorInfo(IntPtr m, ref MONITORINFO i);
[DllImport("user32.dll", EntryPoint = "SetWindowLongPt
rW")] public static extern IntPtr SetWindowLongPtr(IntPtr h, int i, IntPtr v);
[DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr h, IntPtr after, int x, int y, int cx, int cy, uint flags);
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr h);
}
'@
[void][FullWin]::SetProcessDPIAware()
$p = $null
for ($i = 0; $i -lt 180 -and -not $p; $i++) {
$p = Get-Process victory -ErrorAction SilentlyContinue | Where-Object { $_.MainWindowHandle -ne 0 } | Select-Object -First 1
if (-not $p) { Start-Sleep 1 }
}
if (-not $p) { 'no game window'; return }
Start-Sleep 3
$h = $p.MainWindowHandle
$m = [FullWin]::MonitorFromWindow($h, 2)
$info = New-Object FullWin+MONITORINFO
$info.cbSize = [Runtime.InteropServices.Marshal]::SizeOf($info)
[void][FullWin]::GetMonitorInfo($m, [ref]$info)
<#$r = $info.rcMonitor
WS_POPUP | WS_VISIBLE; SWP_FRAMECHANGED | SWP_SHOWWINDOW
[void][FullWin]::SetWindowLongPtr($h, -16, [IntPtr]0x90000000L)
[void][FullWin]::SetWindowPos($h, [IntPtr]::Zero, $r.Left, $r.Top, $r.Right - $r.Left, $r.Bottom - $r.Top, 0x0060)
[void][FullWin]::SetForegroundWindow($h)
"game window made borderless full screen: $($r.Right - $r.Left)x$($r.Bottom - $r.Top) at $($r.Left),$($r.Top)"
#>
Add-Type -AssemblyName System.Windows.Forms
$r = $info.rcMonitor
$mw = $r.Right - $r.Left
$mh = $r.Bottom - $r.Top
Largest 16:9 area that fits, centred
$ww = [int]($mh * 16 / 9)
$wh = $mh
if ($ww -gt $mw) { $ww = $mw; $wh = [int]($mw * 9 / 16) }
$x = $r.Left + [int](($mw - $ww) / 2)
$y = $r.Top + [int](($mh - $wh) / 2)
Black backdrop covering the whole monitor (hides desktop and taskbar)
$bg = New-Object System.Windows.Forms.Form
$bg.FormBorderStyle = 'None'
$bg.BackColor = [System.Drawing.Color]::Black
$bg.StartPosition = 'Manual'
$bg.Location = New-Object System.Drawing.Point($r.Left, $r.Top)
$bg.Size = New-Object System.Drawing.Size($mw, $mh)
$bg.ShowInTaskbar = $false
$bg.TopMost = $true
$bg.Show()
Backdrop never takes focus: WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE
[void][FullWin]::SetWindowLongPtr($bg.Handle, -20, [IntPtr]0x08000088L)
[void][FullWin]::SetWindowPos($bg.Handle, IntPtr, $r.Left, $r.Top, $mw, $mh, 0x0050)
Game: borderless, 16:9, topmost (-1) so it sits above the backdrop
WS_POPUP | WS_VISIBLE; SWP_FRAMECHANGED | SWP_SHOWWINDOW
[void][FullWin]::SetWindowLongPtr($h, -16, [IntPtr]0x90000000L)
[void][FullWin]::SetWindowPos($h, IntPtr, $x, $y, $ww, $wh, 0x0060)
[void][FullWin]::SetForegroundWindow($h)
"game borderless 16:9: ${ww}x${wh} at $x,$y with black backdrop (close the game to exit)"
Keep the backdrop alive until the game exits
while (-not $p.HasExited) {
[System.Windows.Forms.Application]::DoEvents()
Start-Sleep -Milliseconds 100
}
$bg.Close()`
@Pandahodka on GitHub · 2026-12-01 23:50 UTC · original
Hello, How (or where) are we suppose to run your code ? Sorry I'm a noob
@FoxNineOne on GitHub · 2026-12-01 23:59 UTC · original
Easiest way is to download the attachment, rename so it is a .ps1 file. (I had to add ".txt" on the end to allow it to upload on this conversation.)
Run the game in windowed mode, not full screen. Once the game window loads up, right click on the ps1 file, click "open with" and select "PowerShell". The game should then go full screen with black bars.
@Pandahodka on GitHub · 2026-12-02 00:12 UTC · original
Thank you !