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;
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;