|
-
Jan 17th, 2001, 11:58 AM
#1
Thread Starter
PowerPoster
How can I turn the capslock on in C++? I am just making a console program for my computer class, but the program I am making requires you to turn the capslock on for it to work. Thanks.
-
Jan 17th, 2001, 12:59 PM
#2
Frenzied Member
Code:
BYTE bar[256];
GetKeyboardState(bar);
bar[VK_CAPITAL] = 1;
SetKeyboardState(bar);
-
Jan 17th, 2001, 03:29 PM
#3
Thread Starter
PowerPoster
I tried that code, and I get 9 errors. How can I fix this?
Thanks again.
-
Jan 17th, 2001, 05:32 PM
#4
Frenzied Member
The code works fine for me. Did you include windows.h
Code:
#include <windows.h>
....
BYTE bar[256];
GetKeyboardState(bar);
bar[VK_CAPITAL] = 1;
SetKeyboardState(bar);
-
Jan 17th, 2001, 06:11 PM
#5
Thread Starter
PowerPoster
Thanks! I didn't know I had to include windows.h. I'm realitively new to C++ programming, so I don't know all the different headers that are needed. Thank you Vlatko.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|