小
小菜
Unregistered / Unconfirmed
GUEST, unregistred user!
以下代码在win98下正常,在win2000下定义F1至F11都正常,但失败.<br>在Delphi里运行,按下F12后弹出CPU窗口,编译成EXE文件运行时,按F12无反应.<br>请大家帮忙看看<br><br>var<br> F11,F12:THandle;<br><br>procedure TForm1.WMHotkeyHandle(var Msg: TMessage);<br>begin<br>showmessage(intostr(msg.LParamhi));<br>Msg.Result := 1; <br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> F11:= GlobalAddAtom(Pchar('F11')) - $C000;<br> F12:= GlobalAddAtom(Pchar('F12')) - $C000;<br> RegisterHotkey(Handle, F11, 0, 122);<br> RegisterHotkey(Handle, F12, 0, 123);<br>end;<br><br>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br> UnRegisterhotkey(Handle, F11);<br> UnRegisterhotkey(Handle, F12);<br> DeleteAtom(F11);<br> DeleteAtom(F12);<br>end;<br><br>