(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
Re: Tastensimilation an Programm senden
12. Okt 2004, 17:30
Hi,
Sollte so funktionieren:
Delphi-Quellcode:
private
id1: Integer;
procedure WMHotKey( var Msg: TWMHotKey); message WM_HOTKEY;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMHotKey( var Msg: TWMHotKey);
begin
if Msg.HotKey = id1 then
ShowMessage(' Taste A gedrückt !');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
id1 := GlobalAddAtom(' Hotkey1');
RegisterHotKey( Handle, id1, 0, ord(' A'));
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
UnRegisterHotKey( Handle, id1);
GlobalDeleteAtom(id1);
end;
Thomas
|
|
Zitat
|