fs_engaged := 0 ; is "fullscreen" engaged for some window?
padding := 0 ; additional padding width to remove, in pixels
#f::
if (fs_engaged = 0) {
ID:=WinActive("A")
WinGetPos, oldX, oldY, oldW, oldH ; save old dimensions
WinSet, Style, -0xC00000, ahk_id %ID% ; remove titlebar/WS_CAPTION
WinSet, Style, -0x40000 , ahk_id %ID% ; remove borders/WS_SIZEBOX
WinSet, AlwaysOnTop , On, ahk_id %ID%
;; work out current desktop resolution
SysGet, m, Monitor
desk_width := mRight - mLeft
desk_height := mBottom - mTop
WinMove, ahk_id %ID%,, -padding,-padding
,desk_width+2*padding, desk_height+2*padding
fs_engaged:=1
} else {
;; reverse all the operations performed above
WinSet, AlwaysOnTop , Off, ahk_id %ID%
WinSet, Style, +0xC00000, ahk_id %ID%
WinSet, Style, +0x40000 , ahk_id %ID%
WinMove, ahk_id %ID%,, oldX,oldY, oldW,oldH
fs_engaged:=0
}
WinSet, Redraw,,%ID%
return