VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Set/Unset Toggle keys

Keith M Jacobs  (1 Submission)   Complete Applications   Visual Basic 3.0   Advanced   Wed 3rd February 2021

Toggle Num Lock, Caps Lock and Scroll Lock under Windows 95/98/NT/2000

Assumes
Refer to MSKB Q177674

API Declarations
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 ' Maintenance string for PSS usage
End Type
' API declarations:
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Long
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Private Declare Function SetKeyboardState Lib "user32" (lppbKeyState As Byte) As Long
' Constant declarations:
Private Const KEYEVENTF_EXTENDEDKEY = &H1
Private Const KEYEVENTF_KEYUP = &H2
Private Const VER_PLATFORM_WIN32_NT = 2
Private Const VER_PLATFORM_WIN32_WINDOWS = 1

Rate Set/Unset Toggle keys (3(3 Vote))

Download Set/Unset Toggle keys

Set/Unset Toggle keys Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters