替换一个按键

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
HotKeyId: Integer; procedure HotKeyDown(var Msg: Tmessage); message WM_HOTKEY;
procedure TForm1.FormCreate(Sender: TObject);
begin
HotKeyId := GlobalAddAtom('MyHotKey') - $C000;
RegisterHotKey(Handle, hotkeyid, 0, 49);
end;
procedure TForm1.HotKeyDown(var Msg: Tmessage);
begin
if (Msg.LParamHi = 49) then
begin
keybd_event(57, MapVirtualKey( 57, 0 ), 0 , 0 );
keybd_event(57, MapVirtualKey( 57, 0 ), KEYEVENTF_KEYUP , 0 );
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnRegisterHotKey(handle, HotKeyId);
end;
 

Similar threads

I
回复
0
查看
630
import
I
I
回复
0
查看
759
import
I
I
回复
0
查看
563
import
I
I
回复
0
查看
502
import
I
后退
顶部