procedure TWordForm.FormCreate(Sender: TObject);
begin
RegisterHotKey(Handle, $FF00, MOD_CONTROL , 83); //s的ascall code 83
end;
procedure CtrlSHotKey(var message: TMessage); message WM_HOTKEY;
procedure TWordForm.CtrlSHotKey(var message: TMessage);
begin
Case Message.WParam of //按下Ctrl+S 按键
$FF00: begin
SpeedButton7Click(SpeedButton7); //do action
end;
end;
end;
procedure TWordForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnregisterHotKey(Handle,$FF00);
end;