#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #Include #Include HotKeySet ("{ESC}", "Final") HotKeySet ("{SPACE}", "Start") $pos = MouseGetPos() while(1) Sleep(100) WEnd Func Start() While(1) $pos = MouseGetPos() DrawLine(0, 0, $pos[0], $pos[1], 1, 0xFF) WEnd EndFunc Func DrawLine($x1, $y1, $x2, $y2, $width, $colour) Local $DC, $Pen, $obj_orig $Wnd = WinGetHandle("[ACTIVE]", "") $DC = _WinAPI_GetWindowDC($Wnd) $Pen = _WinAPI_CreatePen($PS_SOLID, 2, 0xFF) $obj_orig = _WinAPI_SelectObject($DC, $Pen) _WinAPI_MoveTo($DC,$x1,$y1) _WinAPI_LineTo($DC,$pos[0],$pos[1]) ;Return $DC Sleep(500) _WinAPI_ReleaseDC($Wnd,$DC) EndFunc Func Final() Exit EndFunc