How do I determine Num Lock status?

  • Thread starter Thread starter CK
  • Start date Start date
Hi,

Use the getkeystate api to determine the numlock state. Setup a
timer to update the numlock panel on the statusbar.

Declare Function GetKeyState Lib "user32" Alias "GetKeyState" (ByVal
nVirtKey As Integer) As Boolean

Const VK_NUMLOCK = &H90

Ken
 
Hello,

CK said:
How do I determine the Num Lock status, on or off, and
display it on a status bar?

Untested:

\\\
Private Declare Auto Function GetKeyState Lib "user32.dll" ( _
ByVal nVirtKey As VirtualKey _
) As Boolean

Public Enum VirtualKey As Integer
NumLock = 144
CapLock = 20
End Enum
..
..
..
If GetKeyState(VirtualKey.NumLock) Then
...
End If
///

HTH,
Herfried K. Wagner
 
Back
Top