Good idea, but not what he wants I think.
> I do this by creating a menu and assigning shortcut keys.
To globally do this you can do what I did. I am sure that you can pick the
heck out of my coding, but you will get the principle anyway:
In the DPR (you must do it here to allow your program to use the hotkey)
file I do this:
camshotkey.dohot(0, True);
// and if later you want to clear the hotkey you can set the boolean to
false
// of course the whichhot:word is the # of the hotkey eg 0,1,2 if you define
several hotkeys
I have a unit called
CamsHotkey in 'CamsHotkey.pas';
which is in the uses clause of the DPR
and is:
unit CamsHotkey;
interface
uses windows;
procedure dohot(whichhot:Word;Enabled:boolean);
implementation
uses cams;
procedure dohot(whichhot:Word;Enabled:boolean);
begin
if Enabled then RegisterHotKey(CamForm.Handle,whichhot, MOD_CONTROL, VK_F2)
else UnRegisterHotKey(CamForm.Handle,whichhot);
end;
end.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz