30

I like playing computer games in windowed mode, as opposed to full screen. I don't like staring at the title bar, frame, and other UI junk. I also don't like seeing other stuff on my desktop around the window. Is there a simple Windows program that will strip the UI chrome off of an arbitrary window from some other application? Extra points for an easy way to put a black screen underneath the window, hiding the desktop.

Note: I'm looking specifically to handle windows that are smaller than my desktop size. There's a variety of 'windowed maximized' options that make a window exactly the desktop size, and positioned so all the UI decorations are off screen. (E.g.: ShiftWindow). I'm trying to strip all the decorations away from a window that's smaller than desktop size.

  • For your particular use, though, it depends on which game. Games don't behave like a regular program, when windowed. Some don't even handle this window decoration, and draw directly on the top left corner of the screen, for example. Fact is, it might be hard to find a "universal" solution, as it can depend on how the game is rendered, and how each handles the window mode. – Gnoupi Sep 25 '09 at 7:56

10 Answers 10

15

Just something small that I made for my purposes after reading voodoomsr's comment. Makes it to go left up corner and resizes to my full resolution. Restores as it was before. Can't be used with multiple apps same time.

Thanks voodoomsr

;-Caption
LWIN & LButton::
SetTitleMatchMode, 2
WinGetPos, X, Y, Width, Height, A
WinSet, Style, -0xC00000, A
WinMove,A,,0,0,1920,1080
return
;

;+Caption
LWIN & RButton::
WinSet, Style, +0xC00000, A
WinMove,A,,%X%,%Y%,%Width%,%Height%
Sleep, 1000
Sleep, 1000
return
;

EDIT:

TBH I tried to find something useful for windows that doesn't resize but couldn't find anything (not saying that it's not possible, this was actually my first Autohotkey script).

Well anyhow I made some tweaks like removing unnecessary sleeps, using style that Nelson suggested and making it work with only one button so double-clicking won't override saved variables.

#SingleInstance force

; Exclude the desktop
; Note: Also excludes "My Computer" browsing windows.
;       Better detection might be needed to differentiate the parent explorer "ahk_id" from child windows.
;       Also seems to disregard accidental Metro interface clicks (Win 8+)
#IfWinNotActive ahk_exe explorer.exe

; Set your resolution (minus decorations like start bars if you wish to leave those on-screen.
w = 1920
h = 1080
w_wasted = 6 ; width used by resize bars
h_wasted = 29 ; width used by caption frame and resize bars

; Window to fullscreen
LWIN & LButton::
  SetTitleMatchMode, 2
  WinGet Style, Style, A

  ; 0xC40000 = WS_BORDER (0x800000) + WS_DLGFRAME (0x400000) + WS_SIZEBOX aka WS_THICKFRAME (0x040000)
  if(Style & 0xC00000) { ; if has WS_CAPTION. Ignore sizebox value.
    WinGetPos, X, Y, Width, Height, A
    WinSet, Style, -0xC40000, A ; removes attributes, including sizebox...doesn't do a strict subtraction
    WinMove,A,,0,0,w,h
  } else {
    WinSet, Style, +0xC40000, A
    ; Note: will set WS_SIZEBOX even if not previously present
    if(Width > w - w_wasted) { 
      Width := %w%-%w_wasted%
    }
    if(Height > h - h_wasted) {
      Height := %h%-%h_wasted%
    }
    WinMove,A,,%X%,%Y%,%Width%,%Height%
  }
  WinSet Redraw
  Return
  • 1
    Thanks, that's very close to what I wanted! The only thing that doesn't work well is if the window refuses to resize: it ends up in the upper left with the desktop visible behind. Centered with black behind would be preferable. But if the window is resizeable it's great. One minor tweak: style 0xC40000 seems to work better, it removes the resize handles as well. Also you left some sleeps: are they necessary? – Nelson Mar 16 '11 at 16:38
  • @Nelson For windows refuse to resize, maybe we can just use WinMaxmize and WinRestroe (with auot-hide task-bar). – weakish Sep 24 '12 at 15:20
  • Your second script works perfectly on Windows 10. Thanks a lot, exactly what I was looking for! – Lucas Sep 10 '15 at 20:47
  • @Lucas Happy to help, still using it myself too! – Mikuz Sep 11 '15 at 10:16
  • If I accidentally use this script with my desktop as the active window, first the desktop gets a caption bar and the icons shift down. If I run it again, my icons flat-out disappear. So, there needs to be something to detect if the window is the main explorer.exe and ignore the key+mousestroke. (win 8.1 using windows classic-type interface) – mpag Sep 14 '16 at 18:54
19

just use this autohotkey script:

;-Caption
LWIN & LButton::
WinSet, Style, -0xC00000, A
return
;

;+Caption
LWIN & RButton::
WinSet, Style, +0xC00000, A
return
;

you could download autohotkey from here http://www.autohotkey.com/download/. Save the file with a extension .ahk and run it like any application.

Usage:

to remove the title bar LWindowButton + Left click

to restore the title bar LWindowButton + Right click

  • This works for other cases, like this question of mine: superuser.com/questions/664559/… However, it makes no effect on, say, Google Chrome or it's windowed apps. Any hint here? I think those are custom made bars... – igorsantos07 Oct 24 '13 at 16:36
7

here is a programm that can remove the titlebar for any window. To do that you must select games window in WinExplorer tree view than switch to 'Style' tab and check off WS_DLGFRAME.

  • This is one of the best programs on the internet. I've been using it for years. I really wish it had the ability to run in the system tray and restore all the settings you set for specific apps. ie, some sort of profile support. – Devil's Advocate Jul 30 '13 at 17:33
  • Do you have to run this program and do this every time you run the game? – Nickolai Leschov Aug 28 '17 at 12:57
3

Using AutoHotKey and an auto-hide taskbar.

LWin & f::

WinGet Style, Style, A
if(Style & 0xC40000) {
  WinSet, Style, -0xC40000, A
  WinMaximize, A 

} else {
  WinSet, Style, +0xC40000, A
  WinRestore, A
}
return

Why use WinMaxmize? See comments of Asd's answer.

  • Works fine. I prefer the toggle mode instead of wasting two keys. – ceving Feb 23 '16 at 15:49
2

CutAway by Skrommel might do what you want.

Cut Away

1

i found this at the HydrogenAudio forums:

Here's a screenshot of Foobar 2000 without a window title bar:

enter image description here

The program used is called Flash Desktops (shareware)

Unfortunately they don't really elaborate on the program settings to achieve the goal but rather on the problem of moving windows without a titlebar. WindowBlinds is also mentioned.

0

If you can code and you are running Vista or newer it's pretty easy to make a program that registers a DWM thumbnail to the application and then you can select to only show the window content without borders in this thumbnail. You also have to forward all input from this overlaying program to the game in some way but that's not super complicated either.

0

I no longer run Windows so can't test this, but Borderless Gaming is a promising-looking open source app that solves this problem. It shows a list of running applications and lets you select one to manipulate the windows.

  • Much code for 10 lines AutoHotKey. – ceving Feb 23 '16 at 15:59
0

I was having issues with a particular window, which with @weakish's method and Mikuz's framework would take the correct window size for a maximized window, but wouldn't go to the right position.

Here's my ahk solution

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win2000+
; Author:         mpag derived from Mikuz
;
; Script Function:
;    Window to "supermaximized". mpag solution from http://superuser.com/q/38687/319748
;    If you want fullscreen (no toolbars) try replacing calls to function WinSuperMax with WinFullscreen
; This script may still be in development
; Bugs:
;    1) Doesn't display scrollbars in standard maximized screen if it lost them upon supermax (unless you restore and re-maximize)
;    2) If supermaxing a background window that has menus within the Caption bar (e.g. firefox), you functionally just maximize but lose the min/restore/close buttons. Probably has something to do with the Style value.
; Memory Management/Clarity:
;    3) Doesn't clear G_ variable values before each run. if the number of monitors (virtual or otherwise) reduces, values for higher monitor numbers will still be set, but MonCount should still be valid and restrict use. also picks first match.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

MonGetCoords() {
  global ; for setting
  SysGet G_MonCount, MonitorCount
  loop %G_MonCount% {
    SysGet G_MonWA%A_Index%, MonitorWorkArea, %A_Index%
    SysGet G_MonFS%A_Index%, Monitor, %A_Index%
  }
}

GetMon4xy(ByRef x="", ByRef y="", ByRef m="") {
  global ; getting
  local l:=0, u:=0
  m := 0 ; even if sent, we want to clear it
  loop %G_MonCount% {
    l := G_MonFS%A_Index%Left
    u := G_MonFS%A_Index%Right
    if x not between %l% and %u%
      continue 
    l := G_MonFS%A_Index%Top
    u := G_MonFS%A_Index%Bottom
    if y not between %l% and %u%
      continue 
    m := A_Index
    break
  }
}

WinSetSz(d, mp) {
  global
  local l, r, t, b
  l := %mp%Left
  r := %mp%Right
  t := %mp%Top
  b := %mp%Bottom
  WinMove ahk_id %d%, , l, t, r - l + 1, b - t + 1
  return
}

WinSuperMax(d, m) {
  mp = G_MonWA%m% ; the text of the name of the pointer
  WinSetSz(d, mp)
  return
}

WinFullscreen(d, m) {
  mp = G_MonFS%m%
  WinSetSz(d, mp)
  return
}

; Exclude the desktop
; Note: Also excludes "My Computer" browsing windows.
;       Better detection might be needed to differentiate the parent explorer "ahk_id" from child windows.
;       Also seems to disregard accidental Metro interface clicks (Win 8+).
;       May wish to verify that not only is explorer not the active window, but it wasn't the clicked-in window.

#IfWinNotActive ahk_exe explorer.exe

LWIN & LButton::
RCtrl & LButton::
  SetTitleMatchMode, 2

; monitor bounds and clicked window hwnd
  cm = %A_CoordModeMouse% ; not autoset in older AHK, but shouldn't matter as default is Screen
  CoordMode Mouse, Screen
  MouseGetPos mpx, mpy, d ; was d := WinExist("A") but that would go for the active window, rather than the clicked-in-window
  CoordMode Mouse, %cm%
  MonGetCoords()
  GetMon4xy(mpx, mpy, mpm)

; toggle the style
  WinGet Style, Style, ahk_id %d%
; 0xC40000 = WS_BORDER (0x800000) + WS_DLGFRAME (0x400000) + WS_SIZEBOX or WS_THICKFRAME (0x040000)
  if(Style & 0xC00000) { ; if has WS_CAPTION (WS_BORDER+WS_DLGFRAME) we want to supermax it
    v%d%decs := Style & 0x040000 ; decorations, specifically WS_SIZEBOX
    WinGet v%d%mm, MinMax, ahk_id %d% ; -1=min, 0=normal, 1=max
    WinSet Style, -0xC40000, ahk_id %d% ; removes most window decoration, including WS_SIZEBOX if applicable
; if a "normal" window, get the coords and maximize. If minimized, maximize. If maximized, make sure correctly positioned
    if(!v%d%mm) { ; normal window
      WinGetPos v%d%x, v%d%y, v%d%w, v%d%h, ahk_id %d%
    } if(v%d%mm < 1) { ; normal or minimized
      WinMaximize ahk_id %d% ; set flag to maximized to preserve windows' restore button functionality upon un-supermax to maximized screen
    } 
    WinSuperMax(d, mpm) ; it is now supermaximized. Now make sure it's positioned correctly
  } else { ; it's super-maximized already, so need to restore it to former position.
    if (v%d%decs) {
      WinSet Style, +0xC40000, A ; set WS_SIZEBOX and WS_CAPTION
    } else {
      WinSet Style, +0xC00000, A ; set only WS_CAPTION
    }
    if(v%d%mm = 0) { ; not either previously Maximized nor previously Minimized
      WinRestore ahk_id %d% ; restore standard window + set MinMax flag to non-maxxed 
    } else {
      WinSuperMax(d, mpm) ; Maximized flag should still be set
    }
  }
  WinSet Redraw
;  ListVars
  Return
-1

If you want a window, with no Windows UI around it, and a black background, ie the game and nothing but the game, why not just run in full screen mode? About the only thing windowed mode would be getting you in that circumstance is slightly faster Alt-Tab performance if you've got another app running in the background?

If it's having a playing screen that's smaller than the screen size and with no distractions that you're after, then (presuming you're using an LCD screen) you can normally run in the game's full screen mode, but use a resolution slightly lower than your LCD's native resolution, many LCD screens will show the resulting screen with a black border around it then.

  • I'm looking for faster Alt-Tab performance. Actually more than that; I have a second monitor and want to be able to move my mouse over to it. – Nelson Sep 10 '09 at 0:18
  • Fair enough, I game on a dual-monitor setup and run most games in windowed mode for the same reason. Personally I normally set the game's res to be the same as that screen's res, and manually just drag it so the title bar's off the top of the screen. – GAThrawn Sep 11 '09 at 12:39

protected by studiohack Mar 15 '11 at 14:43

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.