vb.net屏蔽快捷键 vb屏蔽文本框弹出菜单( 二 )


Public Const WH_KEYBOARD_LL = 13
Public Const VK_LWIN = H5B
Public Const VK_RWIN = H5C
Public Const VK_CONTROL = H11
Public Const VK_SHIFT = H10
Public Const HC_ACTION = 0
Public Const HC_SYSMODALOFF = 5
Public Const HC_SYSMODALON = 4
Public Const WM_KEYDOWN = H100
Public Const WM_KEYUP = H101
Public Const WM_SYSKEYDOWN = H104
Public Const WM_SYSKEYUP = H105
Public P As KEYMSGS
Public lHook As Long
Public Function LowLevelKeyboardProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
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)
Select Case P.vKey
Case VK_LWIN, VK_RWIN '如果按了WIN键
fEatKeystroke = True '就吃了
End Select
End If
End If
If fEatKeystroke Then
LowLevelKeyboardProc = -1
Else
LowLevelKeyboardProc = CallNextHookEx(0, nCode, wParam, ByVal lParam)
End If
End Function
vb.net屏蔽快捷键的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vb屏蔽文本框弹出菜单、vb.net屏蔽快捷键的信息别忘了在本站进行查找喔 。

推荐阅读