Sunday, November 6, 2011

How to force Maximized Fullscreen mode in any game?

Question

I have seen several games that have a video display mode that is windowed with no borders, at the same resolution as the desktop. It's sometimes called "Borderless Windowed" mode, or "Maximized Fullscreen" mode. It seems to balance the tradeoff between running in fullscreen, and running a game in windowed mode.

Fullscreen vs Windowed
A game in fullscreen mode fills your screen and is more immersive. Supposedly fullscreen mode provides better performance, but I don't anything about that (nor have I recently observed better performance in fullscreen mode). The most common caveat is that your computer chokes momentarily if you alt-tab to go do something else. Playing in windowed mode allows you to switch to other tasks with no delay, or even multitask. Windowed mode also seems to be better for users using dual displays.

In Maximized Fullscreen mode, the game is in windowed mode, but the borders and title bar are removed and the resolution matches your desktop's. In effect, it looks like you're playing in fullscreen mode, but you can still switch to other applications with no delay. Sounds like the best of both worlds to me!

Left 4 Dead 2 in Windowed (No Border) mode

Multitasking is great if I happen to be respawning, waiting for a loading screen, or if I need to look up information about the game (like looking up quest info for MMOs). Clicking on the game pushes the other (naughty, immersion breaking) windows and the taskbar into the background, seamlessly filling the full screen.

Unfortunately most games don't seem to include this feature yet. For the games that don't, is there a way I can force this mode?

Answer

I have a simple AutoHotkey script that will force this mode for me. The script removes the window border and title bar of any window, and moves the window so that it fills the screen:

^!f::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
    WinSet, Style, ^0xC00000 ; toggle title bar
    WinMove, , , 0, 0, 1920, 1080
}
return

The hotkey this creates is Control+Alt+f. It applies changes to whatever window has focus. If you wanted to use this script, all you'd need to do is:

  1. Install AutoHotkey
  2. Copy the script to a text file and name it something like MaxFull.ahk
  3. Right click on your new script and use Run as Administrator.
    SUDO Autohotkey script

Note that you'll need to have your game in windowed mode, set to your desktop's resolution. Also change "1920, 1080" to whatever your resolution is. Press the hotkey and bam! Maximized Fullscreen goodness. It even toggles back and forth if you press the hotkey again.

While the hotkey works on many games that I've played, some games are stubborn and don't want the window border removed. In that case, I have another hotkey that is a bit more forceful.

^!g::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
   WinSet, Style, -0xC00000 ; hide title bar
   WinSet, Style, -0x800000 ; hide thin-line border
   WinSet, Style, -0x400000 ; hide dialog frame
   WinSet, Style, -0x40000 ; hide thickframe/sizebox
   WinMove, , , 0, 0, 1920, 1080
}   
return

Simply append this to the previous script to enable the hotkey Control+Alt+g.

Update: Some games also use a 0x40000 "ThickFrame" style, which the script wasn't removing until now. See the Autohotkey documentation for a list of styles that can be removed.

No comments:

Post a Comment