搜索了论坛,不知道这下面的API是不是用在这方面 Option Explicit '模块代码 Public Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long Public Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long Public Const WH_MOUSE_LL = 14 '鼠标消息 Public Const WM_RBUTTONDOWN = &H204 Public Const WM_RBUTTONUP = &H205 Public lHook(1) As Long '鼠标钩子 Public Function CallMouseHookProc(ByVal code As Long, ByVal wParam As Long, ByVal lParam As Long) As Long If wParam = WM_RBUTTONDOWN Then CallMouseHookProc = 1 End If If wParam = WM_RBUTTONUP Then CallMouseHookProc = 1 End If If code <> 0 Then CallMouseHookProc = CallNextHookEx(0, code, wParam, lParam) End If End Function |