//注册快捷方式
function TMainForm.RegHotKey: Boolean;
begin
if RegisterHotKey(MainForm.Handle,START_HOT_KEY_ID,MOD_CONTROL or MOD_ALT,$30) and
and RegisterHotKey(MainForm.Handle,SHOW_WINDOW_ID, 0,$6A) then
Result := TRUE
代码:
else
Result := FALSE;
end;
//热键事件
procedure TMainForm.StartByHotKey(var Message: TMessage);
begin
if Message.WParam = START_HOT_KEY_ID then
begin
............
exit;
end;
if Message.WParam = SHOW_WINDOW_ID then
begin
...........
Exit;
end;
end;