Código
//na sessão private declare a procedure:
procedure OnMessageOwn(var Msg: TMsg; var Handled: Boolean);
//implementation
procedure TForm1.OnMessageOwn(var Msg: TMsg; var Handled: Boolean) ;
var
KeyState: TKeyboardState;
begin
GetKeyboardState(KeyState);
if KeyState[VK_NUMLOCK] = 0 then
StatusBar1.Panels[0].Text:= ''
else
StatusBar1.Panels[0].Text:= 'Num';
if KeyState[VK_CAPITAL] = 0 then
StatusBar1.Panels[1].Text:= ''
else
StatusBar1.Panels[1].Text:= 'Caps';
if KeyState[VK_INSERT] = 0 then
StatusBar1.Panels[2].Text:= ''
else
StatusBar1.Panels[2].Text:= 'Ins';
end;
//No método onCreate do Form:
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := OnMessageOwn;
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009