;This script improves "Close" button behaviour of FastStone Image Viewer. ;When the FMViewer is maximized and you click the top-right screen corner the script closes FSViewer ;instead of underlying window (which is the default behaviour due to weird skins). ;Tested only on single-monitor configuration. ; ; (c)2008 by YasonBy ; Feel free to modify :) #IfWinActive, ahk_class FastStoneImageViewerMainForm LButton:: SysGet, area, MonitorWorkArea WinGetPos, winX, winY, winW, winH CoordMode, Mouse, Screen MouseGetPos, mouseX, mouseY if (mouseY==0 && mouseX==(A_ScreenWidth-1)) { if (areaLeft==winX && areaTop==winY && winW==(areaRight-areaLeft) && winH==(areaBottom-areaTop)) ;window is "maximized" { WinClose } else { Click down } } else { Click down } return LButton up:: Click up return #IfWinActive