_DrawSquare(480, 150, 120, 100, 0xFF0000, 3)
_DrawSquare(300, 150, 120, 100, 0x0000FF, 3)
Func _DrawSquare($iLeft, $iTop, $iWidth, $iHeight, $sColor, $iLineWidth=2, $hWnd=0)
$sColor = Hex("0x" & BitAND(BitShift(String(Binary($sColor)), 8), 0xFFFFFF)) ;RGB2BGR
Local $hDC = DllCall("User32.dll", "int", "GetDC", "hwnd", $hWnd)
Local $aPen = DllCall("GDI32.dll", "int", "CreatePen", "int", 0, "int", $iLineWidth, "int", $sColor)
DllCall("GDI32.dll", "int", "SelectObject", "int", $hDC[0], "int", $aPen[0])
DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hDC[0], "int", $iLeft, "int", $iTop, "int", 0)
DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hDC[0], "int", $iLeft+$iWidth, "int", $iTop)
DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hDC[0], "int", $iLeft+$iWidth, "int", $iTop+$iHeight)
DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hDC[0], "int", $iLeft, "int", $iTop+$iHeight)
DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hDC[0], "int", $iLeft, "int", $iTop)
DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "int", $hDC[0])
DllCall("GDI32.dll", "int", "DeleteObject", "int", $aPen[0])
EndFunc