1个回答
展开全部
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Const VK_CAPITAL As Long = &H14
Private Const VK_NUMLOCK As Long = &H90
Private Const VK_SHIFT = &H10
Private Sub Form_Click()
If GetKeyState(VK_CAPITAL) Mod &HFF80 = 1 Then
MsgBox "当前处于大写锁定状态"
Else
MsgBox "当前处于正常输入状态"
End If
If GetKeyState(VK_SHIFT) And CLng(&HFF80) Then
MsgBox "SHIFT键被按下"
End If
End Sub
Private Const VK_CAPITAL As Long = &H14
Private Const VK_NUMLOCK As Long = &H90
Private Const VK_SHIFT = &H10
Private Sub Form_Click()
If GetKeyState(VK_CAPITAL) Mod &HFF80 = 1 Then
MsgBox "当前处于大写锁定状态"
Else
MsgBox "当前处于正常输入状态"
End If
If GetKeyState(VK_SHIFT) And CLng(&HFF80) Then
MsgBox "SHIFT键被按下"
End If
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询