Solved

Caps lock on/off

Posted on 1998-01-05
5
234 Views
Last Modified: 2010-04-04
How do I turn Caps lock, scroll lock and num lock on or off
0
Comment
Question by:koger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 20 total points
ID: 1355276
Here is some code:

procedure TForm1.Button1Click(Sender: TObject);
begin
IF GetKeyState(VK_CAPITAL)=0 THEN showmessage('Caps lock is Off');//1=ON
IF GetKeyState(VK_NUMLOCK)=0 THEN showmessage('Num lock is Off');
IF GetKeyState(VK_SCROLL)=0 THEN showmessage('Scroll lock is Off');
//we send key accelerators
keybd_event(VK_CAPITAL,0,0,0);
keybd_event(VK_CAPITAL,0,KEYEVENTF_KEYUP,0);
keybd_event(VK_NUMLOCK,0,0,0);
keybd_event(VK_NUMLOCK,0,KEYEVENTF_KEYUP,0);
keybd_event(VK_SCROLL,0,0,0);
keybd_event(VK_SCROLL,0,KEYEVENTF_KEYUP,0);
end;

0
 

Author Comment

by:koger
ID: 1355277
I don't seem to get the code to work properly in Win95, but under Win NT, it works great, do you have a clue why this doesn't work.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1355278
I have also tested it under WinNT. As for Win95 I'll Check.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1355279
I checked on win95 and only the numlock didn't work but the others did. I Don't know why this is happening.
0
 

Author Comment

by:koger
ID: 1355280
The same happent to me, guees thats just the Win95 is, I will try asking some Win95 experts, thanks for your help.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question