I updated the code to close the child window/s first if one is present, and only then the parent, or everything at once if the mouse is over the main window's title bar area. For example, a double-right-click over a pdf document should now close the pdf instead of Adobe, Foxit, or whatever Reader is being used.
I find this more convenient than using menus, or clicking the little x at the upper-right corner to close xp windows and applications.
Code:
; close active window w/ dbl right-click
~Rbutton::
KeyWait, Rbutton
KeyWait, Rbutton, d T1
if Errorlevel != 1
{ MouseGetPos,,,,control,1
if control !=
{ Send, {CTRLDOWN}{F4}{CTRLUP}
}
else
{ Send, {ALTDOWN}{F4}{ALTUP}
}
}
return