The information in this article applies to:
SUMMARYThe current state of the CAPS LOCK, SCROLL LOCK, and NUM LOCK keys can be queried and retrieved by the GetKeyboardState function. Although the SetKeyboardState function works on Windows 3.1x, it does not work correctly on Windows 95 or Windows NT. SetKeyboardState retrieves a byte array describing the state of every key. If the low order bit of a toggle key is set, the key is "on." By changing this bit, the toggle key state can be changed. MORE INFORMATIONThe following sample code demonstrates how to change the state of any key on all platforms. Simply pass the virtual key code (VK_CAPITAL, VK_NUMLOCK or VK_SCROLL) and a flag to set or reset the key state to the PostVirtualKeyEvent: Sample Code
Additional query words:
Keywords : kb16bitonly kbInput kbKeyIn kbSDKPlatform kbGrpUser kbUser |
Last Reviewed: June 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |