Hi guys, i'm experimenting WinAPI and Set Windows Hook Ex. Everything work as expected except double click:
AutoIt
#include <WindowsConstants.au3> #include <WinAPI.au3> HotKeySet("{Esc}", "Cleanup") Global $hHook, $hStub_KeyProc _Main() Func _Main() Local $hmod $hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam") $hmod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod) While 1 Sleep(10) WEnd EndFunc ;==>_Main ;=========================================================== ; callback function ;=========================================================== Func _KeyProc($nCode, $wParam, $lParam) Local $tKEYHOOKS, $X, $Y, $Delta $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) Switch $wParam Case $WM_LBUTTONDBLCLK ConsoleWrite("LBUTTONDBLCLK" & @CRLF) EndSwitch Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc ;==>_KeyProc Func Cleanup() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hStub_KeyProc) Exit EndFunc ;==>Cleanup
I don't see any ConsoleWrite...How i can resolve? Where is my error?
Thanks