[code lang=”delphi”]Procedure TForm1.GetStatusInfo;
const
CapPanel = 1;
NumPanel = 2;
ScrlPanel = 3;
DatePanel = 4;
begin
with StatusBar1 do
begin
if GetKeyState(VK_CAPITAL) <> 0 then
StatusBar1.Panels[CapPanel].Text := ‘ CAP’
else
StatusBar1.Panels[CapPanel].Text := ”;
if GetKeyState(VK_NUMLOCK) <> 0 then
StatusBar1.Panels[NumPanel].Text := ‘ NUM’
else
StatusBar1.Panels[NumPanel].Text := ”;
if GetKeyState(VK_SCROLL) <> 0 then
StatusBar1.Panels[ScrlPanel].Text := ‘ SCRL’
else
StatusBar1.Panels[ScrlPanel].Text := ”;
StatusBar1.Panels[DatePanel].Text := FormatDateTime(‘ mmmm D, YYYYY’, now);
end;
End;
[/code]
[tags]Delphi, System, Keyboard[/tags]
0 Kommentare zu “Keys Status”