type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
Procedure WMHotKey(Var msg: TWMHotkey);
message WM_HOTKEY;
public
{ Public declarations }
end;
var
Form1: TForm1;
handle : HWND;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
//RegisterHotKey(handle,1,mod_control+mod_alt+mod_shift,ord('K'));
RegisterHotKey(handle,1,mod_control,ord('K')); //react on CTRL+K
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
UnRegisterHotKey(handle,1);
end;
procedure TForm1.WMHotKey(Var msg: TWMHotkey);
begin
SetForegroundWindow(Application.Handle);
Showmessage('Hello !');
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.