Autor Beitrag
masteroffinalfantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82

Win XP
Delphi 2005 Architect
BeitragVerfasst: Fr 25.05.07 13:12 
Hoi

mal wieder eine Frage:

wie kann man überprüfen, ob Programm x (meinetwegen Notepad) das aktive Fenster ist?
Silas
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 478

Windows XP Home
Delphi 2005, RAD Studio 2007, MASM32, FASM, SharpDevelop 3.0
BeitragVerfasst: Fr 25.05.07 13:19 
Versuch's mal mit dem Fenstertitel des aktiven Fensters. Der "steht" meines Wissens in Screen.ActiveForm.Caption.

_________________
Religionskriege sind nur Streitigkeiten darüber, wer den cooleren imaginären Freund hat ;-)
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Fr 25.05.07 13:26 
Ich habe mir mal flott etwas zusammenbestatelt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var
 hwnd: THandle;
 p : array[0..256] of Char;
begin
 hwnd := Getforegroundwindow;

 if hwnd <> 0 then
  GetWindowText(hwnd, p, 255);

 if (p = 'MeinGesuchterProgrammtitel') then
  ...
end;

grüße
masteroffinalfantasy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82

Win XP
Delphi 2005 Architect
BeitragVerfasst: Fr 25.05.07 13:28 
ich danke euch beiden für die schnelle antwort und werde sofort mal testen :)

Super hab was ich wollte :)