Under Windows2000 (NT) the following code dosen't work with
turning caps/Num lock On Off

Is there a simple solution to making the following sample
code work


- SAMPLE (Written by:VBNet)
Public Const VK_CAPITAL = &H14
Public Type KeyboardBytes
kbByte(0 To 255) As Byte
End Type
Public kbArray As KeyboardBytes
Public Declare Function GetKeyState Lib "user32" _
(ByVal nVirtKey As Long) As Long
Public Declare Function GetKeyboardState Lib "user32" _
(kbArray As KeyboardBytes) As Long
Public Declare Function SetKeyboardState Lib "user32" _
(kbArray As KeyboardBytes) As Long
Code


Private Sub cmdTurnOn_Click()
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPITAL) = 1
SetKeyboardState kbArray


Private Sub cmdTurnOff_Click()
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPITAL) = 0
SetKeyboardState kbArray