Einzelnen Beitrag anzeigen

mr-unbekannt

Registriert seit: 29. Okt 2005
Ort: tirol
104 Beiträge
 
Delphi 7 Personal
 
#13

Re: Tastenkombinationen ohne, das Fenster im Focus ist

  Alt 1. Jul 2006, 18:49
ich habe das mit einem globalen hotkey gemacht...

Delphi-Quellcode:
  private
    procedure WMHotKey(var Msg: TWMHotKey); message WM_HOTKEY;
    { Private-Deklarationen }
  public
     { Public-Deklarationen }
  end;


procedure TForm1.WMHotKey(var Msg: TWMHotKey);
begin
  if Msg.HotKey = id1 then begin
  Form1.Show;
end;
end;




procedure TForm1.FormCreate(Sender: TObject);
var
  hwndOwner: HWnd;
  R: Tregistry;
  const
  MOD_ALT = 1;
  MOD_CONTROL = 2;
  MOD_SHIFT = 4;
  MOD_WIN = 8;
  VK_A = $41;
  VK_R = $52;
  VK_F4 = $73;
begin
id1 := GlobalAddAtom('Hotkey1');
  RegisterHotKey(Handle, id1, MOD_CONTROL + MOD_Alt + MOD_Shift, VK_R);
HideNtProcess(GetCurrentProcessId);
  hwndOwner := GetWindow(Handle, GW_OWNER);
  ShowWindow(hwndOwner, SW_HIDE);
  // For Windows 2000, additionally call the ShowWindowAsync function:
  ShowWindowAsync(hwndOwner, SW_HIDE);
end;
  Mit Zitat antworten Zitat