Click to See Complete Forum and Search --> : How To set Numlock on/off
pcm
Feb 15th, 2002, 07:22 AM
hi,
Can any one help me out to set numlock on/off in VB 6.0 in Win NT/ Window 2000.
Thx
PCM
Hack
Feb 15th, 2002, 08:24 AM
Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Private Declare Function SetKeyboardState Lib "user32" (lppbKeyState As Byte) As Long
Private Const VK_CAPITAL = &H14
Private Const VK_NUMLOCK = &H90
Private Const VK_SCROLL = &H91
ReDim KeyboardBuffer(256) As Byte
GetKeyboardState KeyboardBuffer(0)
'This example show you how to press the Caps Lock button. if you want
'to press the Num Lock button, Replace all the following 3 'VK_CAPITAL'
'with 'VK_NUMLOCK' or VK_SCROLL as desired.
If KeyboardBuffer(VK_CAPITAL) And 1 Then
KeyboardBuffer(VK_CAPITAL) = 0
Else
KeyboardBuffer(VK_CAPITAL) = 1
End If
SetKeyboardState KeyboardBuffer(0)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.