对于窗体上的处理可以用cxx1997的方法,另外,对于全局热键,可以这样做<br>在form.oncreat 事件中登记一个热键<br>hotkeyid:=globaladdatom(pchar('hotkey'))-$c000;<br>registerhotkey(handle,hotkeyid,mod_control,vk_return);//热键为ctrl+enter,其它热键类似<br>定义一个过程<br>procedure wmhotkey(var msg:tmessage);message wm_hotkey;<br>procedure tfrmmain.wmhotkey(var msg:tmessage);<br>begin<br>if (msg.LParamhi=vk_return) and (msg.lparamlo=mod_control) then<br> showmessage('定义了热键ctrl+enter');<br>end;<br>在程序结束的时候释放热键<br>procedure Tfrmmain.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br>unregisterhotkey(handle,hotkeyid);<br>deleteatom(hotkeyid);<br>end;<br>