Solved

how do i show caps' num' scroll lock' insert in a statusbar panels

Posted on 1998-05-08
2
319 Views
Last Modified: 2010-04-03
how do i show caps, num, scroll lock and insert key in a status bars Panels?
0
Comment
Question by:hyperion66
2 Comments
 
LVL 4

Accepted Solution

by:
BoRiS earned 50 total points
ID: 1343480
here two meathods you can use :


Use a TTimer and in its OnTimer event do this:

if (GetKeyState(vk_Capital) and $1) = $1
then ShowMessage('Caps On') {Or update a property etc.} or statusbarpanel[0].text ......
else ShowMessage('Caps Off');

{Use vk_NumLock, vk_Scroll as above}




It's probably better to put this in an OnIdle event...like so:

procedure TMyForm.FormActivate(Sender: TObject);
begin
  inherited;
  Application.OnIdle := AppIdle;
end;

procedure TMyForm.AppIdle(Sender: TObject; var Done: Boolean);
begin
  IF GetKeyState(VK_CAPITAL) <> 0 THEN
    Begin
     StatusBar1.Panels.Items[0].Text := 'CapsLock';
    End
  ELSE
    Begin
     StatusBar1.Panels.Items[0].Text := '';
    End;
  Done := True;  {<- VERY important}
end;

Later
BoRiS
0
 

Author Comment

by:hyperion66
ID: 1343481
thank's again BoRiS's.
0

Featured Post

Technology Partners: 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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

679 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