|
发表于 2010-5-5 11:08:53
|
显示全部楼层
可以但是 代码比较复杂
#include <WinAPI.au3>
Global $hM_Hook
_MouseSetOnEvent()
Sleep(2000)
OnAutoItExit()
Func OnAutoItExit();结束鼠标钩子
DllCall("user32.dll", "int", "UnhookWindowsHookEx", "hwnd", $hM_Hook[0])
EndFunc
Func _MouseSetOnEvent();鼠标钩子挂钩
$hKey_Proc = DllCallbackRegister("_Mouse_Events_Handler", "int", "int;ptr;ptr")
$hM_Module = DllCall("kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0)
$hM_Hook = DllCall("user32.dll", "hwnd", "SetWindowsHookEx", "int", $WH_MOUSE_LL, _
"ptr", DllCallbackGetPtr($hKey_Proc), "hwnd", $hM_Module[0], "dword", 0)
EndFunc
Func _Mouse_Events_Handler($nCode, $wParam, $lParam);鼠标钩子回调函数
Return 1
EndFunc
学习了, |
|