Autor Beitrag
hunni
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Mi 14.03.07 00:55 
Hallo,

wie kann ich festellen ob meine Form (Programm) den Focus wieder erhält ?

Zur Zeit stehe ich dabei etwas auf dem Schlauch :?:

Torsten
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 14.03.07 02:50 
Die Funktion Suche in: Delphi-Forum, Delphi-Library GETFOREGROUNDWINDOW gibt an welches Fenster gerade den Fokus hat. Wenn true:=handle=getForegroundWindowdann hat deine Form den Fokus.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mi 14.03.07 09:28 
Hallo,

OnActivate der Application ist das passende Ereignis:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
  public
    procedure AppActivate(Sender: TObject);
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnActivate := AppActivate;
end;

procedure TForm1.AppActivate(Sender: TObject);
begin
  showmessage('aktiviert');
end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
hunni Threadstarter
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Mi 14.03.07 11:00 
user profile iconKarlson hat folgendes geschrieben:
Die Funktion Suche in: Delphi-Forum, Delphi-Library GETFOREGROUNDWINDOW gibt an welches Fenster gerade den Fokus hat. Wenn true:=handle=getForegroundWindowdann hat deine Form den Fokus.


Danke,

Das war genau das wo nach ich gesucht habe :idea:

Torsten