#include <WinAPI.au3>
#include <WindowsConstants.au3>
Global $_whand = DllCallbackRegister("_Mouse_Events_Handler", "int", "int;ptr;ptr")
Local $_whmod = _WinAPI_GetModuleHandle(0)
Global $_whook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($_whand), $_whmod)
While 1
Sleep(10)
WEnd
Func _Mouse_Events_Handler($wnCode, $wwParam, $wlParam)
Switch $wwParam
Case $WM_MOUSEMOVE ;鼠标移动
Local $aPos = MouseGetPos()
Local $iX = $aPos[0]
Local $iY = $aPos[1]
ConsoleWrite($iX & '/' & $iY & @CRLF)
EndSwitch
EndFunc ;==>_Mouse_Events_Handler
|