delphi firemonkey win注册全局热键

校园文化作者 / 东华信息 / 2026-04-19 22:10
"
delphi firemonkey win注册全局热键相关话题近期引发广泛关注,我们特别整理了多维度信息,希望能为您提供有价值的参考。private

delphi firemonkey win注册全局热键相关话题近期引发广泛关注,我们特别整理了多维度信息,希望能为您提供有价值的参考。

private aatom:atom; c:atom; procedure hotkey(var msg:tmessage);message wm_hotkey; //定义全局热键消息事件 { Private declarations } public { Public declarations } end;var Form1: TForm1;a,b:integer;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);beginaatom:=globaladdatom('hotkey');c:=globaladdatom('hotkey1'); //全局热键IDRegisterHotKey(handle,aatom,MOD_ALT,vk_f12); //注册全局热键RegisterHotKey(handle,c,MOD_ALT,vk_f11);end;procedure TForm1.hotkey(var msg:tmessage); //热键响应事件begin if (msg.LParamHi=VK_F12) and (msg.LParamLo=MOD_ALT) then //全局热键 ALT+F12 begin a:=a+1; a:=a mod 2; if a=1 then checkbox1.Checked:=true else checkbox1.Checked:=false end; if (msg.LParamHi=VK_F11) and (msg.LParamLo=MOD_ALT) then b:=b+1; b:=b mod 2; if b=1 then checkbox2.Checked:=true else checkbox2.Checked:=falseend;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);beginglobalDeleteatom(aatom);globalDeleteatom(c);end;以前写的 改下就行了

以上就是关于delphi firemonkey win注册全局热键的全部介绍,如果觉得有用,请收藏本站。

分享到
声明:本文为用户投稿或编译自英文资料,不代表本站观点和立场,转载时请务必注明文章作者和来源,不尊重原创的行为将受到本站的追责;转载稿件或作者投稿可能会经编辑修改或者补充,有异议可投诉至本站。

热文导读