用RegisterHotKey可以给控键注册多个热键吗?(如不可以如何实现呢?)
用RegisterHotKey可以给控键注册多个热键吗?(如不可以怎么实现呢?)
早上brightyang帮我解决的注册热键盘的问题,在这里谢谢他了。但是又有新的问题我用RegisterHotKey不能给组键注册多个热键的。不知道这个是要怎么实现,能不能给我指点指点各位大大。代码如下,但是不能实现。
------解决方案--------------------
RegisterHotKey的第2个参数对应
WM_HOTKEY消息的wParam参数
所以你不能
HotKey:=GlobalAddAtom( "HotKey ");
RegisterHotKey(handle,HotKey,0,VK_F8);
RegisterHotKey(handle,HotKey,MOD_ALT,VK_F8);
要分开申请
HotKey1:=GlobalAddAtom('HotKey1');
RegisterHotKey(handle,HotKey1,0,VK_F8);
HotKey2:=GlobalAddAtom('HotKey2');
RegisterHotKey(handle,HotKey2,MOD_ALT,VK_F8);
procedure TForm1.hotykey(var msg:TMessage);
begin
if msg.wParam =HotKey1 then;
...
...
if msg.wParam =HotKey2 then;
...
...
end;
早上brightyang帮我解决的注册热键盘的问题,在这里谢谢他了。但是又有新的问题我用RegisterHotKey不能给组键注册多个热键的。不知道这个是要怎么实现,能不能给我指点指点各位大大。代码如下,但是不能实现。
------解决方案--------------------
RegisterHotKey的第2个参数对应
WM_HOTKEY消息的wParam参数
所以你不能
HotKey:=GlobalAddAtom( "HotKey ");
RegisterHotKey(handle,HotKey,0,VK_F8);
RegisterHotKey(handle,HotKey,MOD_ALT,VK_F8);
要分开申请
HotKey1:=GlobalAddAtom('HotKey1');
RegisterHotKey(handle,HotKey1,0,VK_F8);
HotKey2:=GlobalAddAtom('HotKey2');
RegisterHotKey(handle,HotKey2,MOD_ALT,VK_F8);
procedure TForm1.hotykey(var msg:TMessage);
begin
if msg.wParam =HotKey1 then;
...
...
if msg.wParam =HotKey2 then;
...
...
end;