procedure WMHotKey(var Message: TWMHOTKEY); message WM_HOTKEY;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> RegisterHotKey(Handle, GlobalAddAtom('hotkey'),MOD_CONTROL,VK_F1);<br>end;<br><br>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br> UnregisterHotKey(Handle, GlobalAddAtom('hotkey'));<br>end;<br><br>procedure TForm1.WMHotKey(var Message: TWMHOTKEY);<br>begin<br> application.MessageBox('你按了CTRL+F1','标题',mb_ok);<br>end;<br>