it works but i want to modify it a bit
1) can i make it to unfilled rectangle rather than filled?
currently it's filled with white.
2) it behave something weird when i resize the rectangle from larger to smaller size
it look like i drawing several rectangles at same time
can anyone enlighten me plz
;http://www.autohotkey.com/forum/topic31064.html coordmode, mouse, screen lbutton:: mousegetpos,x1,y1 settimer, rectangle, 100 return lbutton UP:: DllCall("ReleaseDC", UInt, 0, UInt, hDrwArea) DllCall("FreeLibrary", "UInt", hDrwArea) DllCall("RedrawWindow", "Uint", 0, "Uint", 0, "Uint", 0, "Uint", 0x81) settimer, rectangle, off return rectangle: mousegetpos,x2,y2,win winset,redraw,,ahk_id %win% drawrect(x1,y1,x2,y2) return drawrect(x1,y1,x2,y2,color=0x0000ff) { guiID := WinExist() hdc := DllCall("GetDC", "UInt", guiID, "UInt") ps_Dash:=0 hPen := DllCall("CreatePen", "Int",PS_DASH, "Int", 4, "Int", color, "UInt") objB := DllCall("SelectObject", "UInt", hdc, "UInt", brush, "UInt") objP := DllCall("SelectObject", "UInt", hdc, "UInt", hPen, "UInt") DllCall("Rectangle", "UInt", hdc, "Int", x1, "Int", y1, "Int", x2, "Int", y2) } escape:: exitapp return