关于SetWindowsHookEx函数的问题
PrivateSubForm_Load()callSetWindowsHookEx(2,AddressOfKEY,0&,0)'监视键盘EndSub以下是模块中的代码:Pu...
Private Sub Form_Load()
call SetWindowsHookEx(2, AddressOf KEY, 0&, 0) '监视键盘
End Sub
以下是模块中的代码:
Public Sub KEY(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long)
MsgBox 123465
End Sub
结果我在键盘上乱敲,并未弹出123456,请问下大家这是为什么哪里错了呢? 展开
call SetWindowsHookEx(2, AddressOf KEY, 0&, 0) '监视键盘
End Sub
以下是模块中的代码:
Public Sub KEY(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long)
MsgBox 123465
End Sub
结果我在键盘上乱敲,并未弹出123456,请问下大家这是为什么哪里错了呢? 展开
1个回答
展开全部
Public Function MyKBHook2(ByVal ncode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Call CallNextHookEx(hHook, ncode, wParam, lParam) '将消息传给下一个钩子
End Function
可能原因,1、sub-〉function,回调函数有一定的格式不能乱写,
2、lParam As Long) As Long
3、(2, AddressOf KEY, 0&, App.ThreadID)
Call CallNextHookEx(hHook, ncode, wParam, lParam) '将消息传给下一个钩子
End Function
可能原因,1、sub-〉function,回调函数有一定的格式不能乱写,
2、lParam As Long) As Long
3、(2, AddressOf KEY, 0&, App.ThreadID)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询