Status of NumLock, ScrollLock and CapsLock
Const VK_CAPITAL = &H14
Const VK_NUMLOCK = &H90
Const VK_SCROLL = &H91
Private Type KeyboardBytes
kbByte(0 To 255) As Byte
End Type
Private Declare Function GetKeyboardState Lib "user32" (kbArray As
KeyboardBytes) As Long
Sub testkb()
Dim kb As KeyboardBytes
GetKeyboardState kb
MsgBox _
"NumLock: " & kb.kbByte(VK_NUMLOCK) & vbLf & _
"ScrollLock : " & kb.kbByte(VK_SCROLL) & vbLf & _
"CapslLock : " & kb.kbByte(VK_CAPITAL)
End Sub
HTH
--
AP
"Peter Rooney" a écrit dans le
message de ...
Good morning,
I'm SURE I found the answer to this on here somewhere, but I can't find it
now.
Can anybody please tell me how to determine the status of the lock keys -
that is, whether NumLock, ScrollLock and capsLock are on or off?
Thanks in advance
Pete
|