Autor Beitrag
FrankBurian
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 57



BeitragVerfasst: Sa 24.02.07 12:41 
Hallo,

ich beschäftige mich mit dem Problem, eine Liste bestimmter Seiten die im IE, Firefox und Opera geöffnet sind, an hand des Fenstertitels zu schließen! Hab versucht erstmal mit FindWindow alle aktiven Fenster zu ermitteln.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
// Hier werden erstmal alle gefundenen in eine Listbox aufgelistet!
procedure TForm1.Button1Click(Sender: TObject);
var
  hwnd : THandle;
  p : array[0..256of Char;
begin
  hwnd := FindWindow(nilnil);
  while hwnd <> 0 do begin
    hwnd := GetWindow(hwnd, GW_HWNDNEXT);
    GetClassName(hwnd, P, SizeOf(P));
    // Firefox
    if string(P) = 'MozillaUIWindowClass' then begin
      GetWindowText(hwnd, P, 255);
      Listbox1.items.add(P);
    end;
    // IE
    if string(P) = 'IEFrame' then begin
      GetWindowText(hwnd, P, 255);
      Listbox1.items.add(P);
    end;
    // Opera
    if string(P) = 'OpWindow' then begin
      GetWindowText(hwnd, P, 255);
      Listbox1.items.add(P);
    end;
  end;
end;

Hier hab ich das Problem das immer nur der aktive Tab angezeigt wird, und alle die nicht aktiv sind werden nicht angezeigt! Hat jemand eine Ahnung???

Danke!
FrankBurian Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 57



BeitragVerfasst: Mo 26.02.07 21:41 
???