-
1
- #1
mischmasch
Programmer
- May 10, 2011
- 11
Hello,
In my App I have some HotKey that is registred, unregistred like below:
type
TufMain = class(TForm)
...
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
ExecuteHotKey: Integer;
procedure WMHotKey(var Msg: TWMHotKey); message WM_HOTKEY;
public
{ Public declarations }
end;
....
....
procedure TufMain.WMHotKey(var Msg: TWMHotKey);
begin
if (msg.HotKey = ExecuteHotKey) then
... something to do
end;
procedure TufMain.FormCreate(Sender: TObject);
begin
ExecuteHotKey := GlobalAddAtom('ExecuteHotKey');
RegisterHotKey(Handle, ExecuteHotKey, 0, VK_F2);
end;
procedure TufMain.FormDestroy(Sender: TObject);
begin
UnRegisterHotKey(Handle, ExecuteHotKey);
GlobalDeleteAtom(ExecuteHotKey);
end;
In mp App everything works OK, but I've noticed that when I use other application where F2 can be used, I cannot use it, e.g. Excel - I want to edit cell by pressing F2, but it does not work.
I must close my App and then F2 in Excel works normally.
With other HotKey that are the same in my App and other applications (e.g. ESC), is the same.
It seems that my App blocks HotKey in other applications ...
Does anyone know how to solve it?
Thank you in advance.
In my App I have some HotKey that is registred, unregistred like below:
type
TufMain = class(TForm)
...
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
ExecuteHotKey: Integer;
procedure WMHotKey(var Msg: TWMHotKey); message WM_HOTKEY;
public
{ Public declarations }
end;
....
....
procedure TufMain.WMHotKey(var Msg: TWMHotKey);
begin
if (msg.HotKey = ExecuteHotKey) then
... something to do
end;
procedure TufMain.FormCreate(Sender: TObject);
begin
ExecuteHotKey := GlobalAddAtom('ExecuteHotKey');
RegisterHotKey(Handle, ExecuteHotKey, 0, VK_F2);
end;
procedure TufMain.FormDestroy(Sender: TObject);
begin
UnRegisterHotKey(Handle, ExecuteHotKey);
GlobalDeleteAtom(ExecuteHotKey);
end;
In mp App everything works OK, but I've noticed that when I use other application where F2 can be used, I cannot use it, e.g. Excel - I want to edit cell by pressing F2, but it does not work.
I must close my App and then F2 in Excel works normally.
With other HotKey that are the same in my App and other applications (e.g. ESC), is the same.
It seems that my App blocks HotKey in other applications ...
Does anyone know how to solve it?
Thank you in advance.