04.05.2012, 21:52
|
Прохожий
|
|
Регистрация: 17.03.2012
Сообщения: 42
Репутация: -63
|
|
и в чём беда
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
hotkey1, hotkey2: 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 = hotkey1 then keybd_event(144,0,0,0);
if msg.HotKey = hotkey1 then keybd_event(144,0,keyeventf_keyup,0 );
end;
procedure TForm1.FormCreate(Sender: TObject);
const MOD_CONTROL = 2;
VK_A = 65;
begin
hotkey1 := GlobalAddAtom('Hotkey1');
RegisterHotKey(handle, hotkey1, MOD_CONTROL,VK_A);
end;
end.
|