精简一下你的代码吧。我试过,用下面的代码肯定可以工作:procedure TForm1.WMhotkeyhandle(var msg:tmessage); begin if (Msg.LParamHi = $41) and (Msg.LParamLo = Mod_Control or Mod_Alt) then begin msg.Result:=1; MessageBox(0,'a','b',MB_OK); end; end;
procedure WndProc(var Msg: TMessage); message WM_Hotkey;改为 procedure WndProc(var Msg: TMessage);procedure WndProc(var Msg: TMessage); begin with Msg do if Msg = WM_Hotkey then begin
begin
if (Msg.LParamHi = $41) and (Msg.LParamLo = Mod_Control or Mod_Alt) then
begin
msg.Result:=1;
MessageBox(0,'a','b',MB_OK);
end;
end;
我没看见呀
怎么也的写个这样的语句:
FOnHotkey := OnHotKey //假设已定义了 procedure OnHotKey ...
procedure WndProc(var Msg: TMessage);procedure WndProc(var Msg: TMessage);
begin
with Msg do
if Msg = WM_Hotkey then begin