[求助]钩子截获消息后
事情是这样的。在我截获按键消息后,也就是 win(窗口)键,我想给屏蔽掉。不知道有没有办法。
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 CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long
Public Hook1 As Long
Public Const WH_KEYBOARD = 2
Public Const VK_LWIN = &H5B
Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Public Function MyHook(ByVal ncode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If ncode >= 0 Then
MyHook = 0
If wParam = &H5B <> 0 Then
If (lParam And &HC000000) = 0 Then '截获按下窗口键。。。
MyHook = 1
End If
End If
End If
Call CallNextHookEx(Hook1, ncode, wParam, lParam)
End Function
请指点。谢谢。