i almost have a working example... i found the example script online for drawing a simple square then i added MouseGetPos()
this almost works, but the rectangle changes size as your mouse moves around, im trying to keep a consistant size...
edit
_WinAPI_DrawRect($left, $top, $bottem, $right, 0x0000CC)
I hate making the post and fixing my script a few minutes later... been a few years since i played with autoit... still love it ;-)
#include
#include
Global $tRect
While 1
$fov = MouseGetPos()
$top = $fov[1] - 100
$bottem = $fov[1] + 100
$left = $fov[0] - 50
$right = $fov[0] + 50
; refresh desktop
_WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), $tRect, 0, BitOR($RDW_INVALIDATE, $RDW_ALLCHILDREN))
_WinAPI_DrawRect($left, $top, $bottem, $right, 0x0000CC)
Sleep(10)
WEnd
Func _WinAPI_DrawRect($start_x, $start_y, $iWidth, $iHeight, $iColor)
Local $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop)
$tRect = DllStructCreate($tagRECT)
DllStructSetData($tRect, 1, $start_x)
DllStructSetData($tRect, 2, $start_y)
DllStructSetData($tRect, 3, $iWidth) ; x-coordinate of the lower-right corner of the rectangle
DllStructSetData($tRect, 4, $iHeight) ; y-coordinate of the lower-right corner of the rectangle
Local $hBrush = _WinAPI_CreateSolidBrush($iColor)
_WinAPI_FrameRect($hDC, DllStructGetPtr($tRect), $hBrush)
; clear resources
_WinAPI_DeleteObject($hBrush)
_WinAPI_ReleaseDC(0, $hDC)
EndFunc ;==>_WinAPI_DrawRect