Solved

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

Posted on 1998-05-08
2
316 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 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