How to force Maximized Fullscreen mode in any game?
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:
- Install AutoHotkey
- Copy the script to a text file and name it something like
MaxFull.ahk
- Right click on your new script and use
Run as Administrator
.
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.
There's a very simple utility that I've used for ages to accomplish this very purpose. It was originally written for EVE Online, but it will support any game.
Gamers Window Relocator
When you install it, it looks like this:
You basically choose the game you're running, and it will automatically move the game to completely fill the window.
The advantage of this over the AHK method mentioned earlier applies mostly to users of multiple windows. It will automatically clamp to the nearest corner. So if you move the window to your second monitor, it will automatically fill your second monitor instead of your first. This way you don't need multiple scripts for every monitor.
It also works automatically, without any hotkey.
I dont like semi automation (having to press a key every single time you start a game) so I wrote python script that starts games for me. Example for World of Tanks:
import win32gui
from win32con import GWL_STYLE, WS_CAPTION, WS_SIZEBOX, WS_DLGFRAME, WS_THICKFRAME
import time
import os
def main():
os.system("start \"..\" G:\\World_of_Tanks\\xvm-stat.exe")
# option = combination of those four: WS_CAPTION, WS_SIZEBOX, WS_DLGFRAME, WS_THICKFRAME
option = WS_CAPTION + WS_SIZEBOX
# window_name = name that appears on application title bar
window_name = "W.o.T. Client"
time.sleep(5)
for x in range(60):
time.sleep(1)
hwnd = win32gui.FindWindow(None, window_name)
if hwnd !=0:
win32gui.MoveWindow(hwnd, 0,0,1599,1200, True)
gwl = win32gui.GetWindowLong(hwnd, GWL_STYLE)
win32gui.SetWindowLong(hwnd, GWL_STYLE, (gwl ^ option))
break
if __name__ == '__main__':
main()
it spawns the game, waits 5 seconds, starts to look for "W.o.T. Client" window for 60 seconds retrying every second, When it finally finds one it does its magic and quits.