private<br> { Private declarations }<br> procedure WMHotkeyHandle(var Msg: TMessage); message WM_HOTKEY; //响应敏感键按键消息<br><br>var<br> HotkeyId: THandle;<br><br>procedure TForm1.WMHotkeyHandle(var Msg: TMessage);<br>begin<br> if (Msg.LParamHi = $70) and (msg.lparamLo = 0) then<br> begin<br> Msg.Result := 1; //该消息已经处理<br> ShowMessage('');<br> end;<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> HotkeyId := GlobalAddAtom(Pchar('UserDefineHotKey')) - $C000;<br> RegisterHotkey(Handle, Hotkeyid, 0, $70);<br>end;<br><br>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br> UnRegisterhotkey(Handle, HotkeyId);<br> DeleteAtom(HotKeyID);<br>end;<br>