Submitted by daniel.a.lopez on Sun, 12/14/2008 - 05:32.
Ctrl+Alt+W is more convient than Alt+f4... Also a another quick way of closing windows is to rightclick while middle clicking which closes anything your mouse is currently over, including items in the taskbar...
^!w::
send !{F4}
return
~RButton & ~MButton::
WinGet, old_active, ID, A ; Grab the old active window to re-activate at the end
MouseGetPos, MouseX, MouseY, MouseWin ; Grab the window thats currently under the mouse and
WinActivate, ahk_id %MouseWin%
WinGetClass, class, ahk_id %MouseWin%
if class = Shell_TrayWnd
{
send, {click}
WinKill, A
}
else
{
WinKill, A
}
WinActivate, ahk_id %old_active%
return