the *Lock keys (quick question)
This may sound a little silly, but i''d like to be able to see the value of 3 bool variables by useing the "Caps Lock", "Scroll Lock", and "Num Lock" lights on my keyboard. Now i know there has to be a realy easy way to toggle/set the value of those things, but i just can''t seem to figure out how.
Thanx in advance for the help.
-------------------------------------------------
Don''t take life too seriously, you''''ll never get out of it alive. -Bugs Bunny
Anyone?
-------------------------------------------------
Don''t take life too seriously, you''''ll never get out of it alive. -Bugs Bunny
-------------------------------------------------
Don''t take life too seriously, you''''ll never get out of it alive. -Bugs Bunny
To toggle the NUM LOCK, CAPS LOCK, or SCROLL LOCK keys, you can use the following logic:
Use the GetKeyboardState function to determine the state of the key.
Determine which operating system is being used with the GetVersionEx API. (Windows 95/98 and Windows NT/2000 require different methods for toggling these keys.)
Under Windows 95 or Windows 98, use the SetKeyboardState API function to set the state of the key. Under Windows NT or Windows 2000, use the keybd_event function to simulate a key press.
Pls refer to MSDN for details.
Use the GetKeyboardState function to determine the state of the key.
Determine which operating system is being used with the GetVersionEx API. (Windows 95/98 and Windows NT/2000 require different methods for toggling these keys.)
Under Windows 95 or Windows 98, use the SetKeyboardState API function to set the state of the key. Under Windows NT or Windows 2000, use the keybd_event function to simulate a key press.
Pls refer to MSDN for details.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement