Advertisement
Hollowyearz

Mouse Finder Tool

Jan 11th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.92 KB | None | 0 0
  1. #include <Misc.au3>
  2. #include <GuiConstants.au3>
  3.  
  4. $GUICoord = GUICreate('Mouse Finder Tool', '150', '20', '-1', '-1', '-1', '128')
  5. Global $CoordInput = GUICtrlCreateInput('', '0', '0', '150', '20', '1')
  6. GUICtrlSetFont($CoordInput, '9', '600', '', 'Arial')
  7. GUICtrlSetState($CoordInput, $GUI_DISABLE)
  8. GUISetState(@SW_SHOW, $GUICoord)
  9. WinSetOnTop($GUICoord, '', '1')
  10. AdlibRegister("RefreshCoord", 50)
  11.  
  12. Local $hDLL = DllOpen("user32.dll")
  13.  
  14. While 1
  15.     If _IsPressed("01", $hDLL) Then
  16.         $Pos = MouseGetPos()
  17.         ConsoleWrite("X: " & $Pos['0'] & "  Y: " & $Pos['1'] & @CRLF)
  18.         While _IsPressed("01")
  19.             Sleep(1)
  20.         WEnd
  21.     EndIf
  22.     If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
  23. WEnd
  24.  
  25. DllClose($hDLL)
  26. AdlibUnRegister("RefreshCoord")
  27. GUIDelete($GUICoord)
  28.  
  29. Func RefreshCoord()
  30.     $Pos = MouseGetPos()
  31.     GUICtrlSetData($CoordInput, "X: " & $Pos['0'] & "  Y: " & $Pos['1'])
  32. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement