VB只屏蔽ctrl或者alt,为什么下面的代码 还是不能屏蔽alt+ctrl+Z????? 10
DimfEatKeystrokeAsBooleanIf(nCode=HC_ACTION)ThenIfwParam=WM_KEYDOWNOrwParam=WM_SYSKEY...
Dim fEatKeystroke As Boolean
If (nCode = HC_ACTION) Then
If wParam = WM_KEYDOWN Or wParam = WM_SYSKEYDOWN Or wParam = WM_KEYUP Or wParam = WM_SYSKEYUP Then
CopyMemory p, ByVal lParam, Len(p)
fEatKeystroke = ((p.vkCode = 9)) Or ((p.vkCode = 27)) Or ((p.vkCode = 91)) Or ((p.vkCode = 92)) Or ((p.vkCode = 17)) Or ((p.vkCode = 18))
End If
End If
If fEatKeystroke Then
CallKeyHookProc = 1 ' 设置为 1 可以屏蔽按键
Else
CallKeyHookProc = CallNextHookEx(0, nCode, wParam, ByVal lParam) 展开
If (nCode = HC_ACTION) Then
If wParam = WM_KEYDOWN Or wParam = WM_SYSKEYDOWN Or wParam = WM_KEYUP Or wParam = WM_SYSKEYUP Then
CopyMemory p, ByVal lParam, Len(p)
fEatKeystroke = ((p.vkCode = 9)) Or ((p.vkCode = 27)) Or ((p.vkCode = 91)) Or ((p.vkCode = 92)) Or ((p.vkCode = 17)) Or ((p.vkCode = 18))
End If
End If
If fEatKeystroke Then
CallKeyHookProc = 1 ' 设置为 1 可以屏蔽按键
Else
CallKeyHookProc = CallNextHookEx(0, nCode, wParam, ByVal lParam) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询