procedure TForm1.FormCreate(Sender: TObject);
begin
id := GlobalAddAtom('GetScreenColor_HotKey_F12');
if not RegisterHotKey(Form1.Handle, id, 0, $7B) then //Register F12
ShowMessage('Can not Register HotKey!');
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
if not UnregisterHotKey(Form1.Handle, id) then
ShowMessage('Can not Unregister HotKey!');
GlobalDeleteAtom(id);
end;
procedure TForm1.WMhotKey(var Message: TMessage);
begin
if HIWORD(Message.lParam) = $7B then
begin
//do what u want
end;
end;