Hotkey

Avagy billentyükombináció, ami minden applikációból elérhető.

A "Shift+a" betü lenyomására lefut a HOTKEY procedura, mindegy, hogy milyen applikációban van a windows, és egyben le is nyeli a rendszer a leütött billentyüt.

mod_alt , mod_control , mod_shift , mod_win

private
procedure hotykey(var msg:TMessage); message WM_HOTKEY;
. . .

var
Form1: TForm1;
id:Integer;
. . .

procedure TForm1.hotykey(var msg:TMessage);
begin
caption:=inttostr(msg.LParamHi);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
id:=GlobalAddAtom('hotkey');
RegisterHotKey(handle,id,mod_shift,65);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
UnRegisterHotKey(handle,id);
end;