|
how i can detect whether the capslock is on using API? (in VB application)
|
|
|
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Sub Command1_Click()
Dim lngWhatState As Long
lngWhatState = GetKeyState(vbKeyCapital)If lngWhatState = 1 Then
MsgBox "The Caps Lock Is On"
Else
MsgBox "The Caps Lock Is Off"
End If
End Sub
<Added>
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Sub Command1_Click()
Dim lngWhatState As Long
lngWhatState = GetKeyState(vbKeyCapital)
If lngWhatState = 1 Then
MsgBox "The Caps Lock Is On"
Else
MsgBox "The Caps Lock Is Off"
End If
End Sub
|
|
|
|
|
|
|
// |