procedure AppOnIdle(Sender: TObject; var Done: Boolean);
...
procedure TForm1.AppOnIdle(Sender: TObject; var Done: Boolean);
begin
CheckBox1.Checked := Odd(GetKeyState(VK_CAPITAL));
CheckBox2.Checked := Odd(GetKeyState(VK_SHIFT));
CheckBox3.Checked := Odd(GetKeyState(VK_NUMLOCK));
CheckBox4.Checked := Odd(GetKeyState(VK_SCROLL));
Done := False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnIdle := AppOnIdle;
end;
|