谁说RegisterHotKey只能注册一个呀?
procedure TForm1.FormCreate(Sender: TObject);
begin
id:=GlobalAddAtom('MyHotkey');
id1:=GlobalAddAtom('MyHotkey1');
id2:=GlobalAddAtom('MyHotkey2');
RegisterHotKey(Handle, id, MOD_CONTROL, VK_F1);
RegisterHotKey(Handle, id1, MOD_CONTROL, VK_F2);
RegisterHotKey(Handle, id2, MOD_CONTROL, VK_F3);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
UnregisterHotKey(Handle,ID);
UnregisterHotKey(Handle,ID1);
UnregisterHotKey(Handle,ID2);
end;
procedure TForm1.WMHotKey(var Msg: TWMHotKey);
begin
if msg.HotKey=ID then
ShowMessage('Ctrl+F1!')
else if Msg.HotKey=ID1 then
ShowMessage('Ctrl+F2!')
else if Msg.HotKey=ID2 then
ShowMessage('Ctrl+F3!');
end;