Einzelnen Beitrag anzeigen

Benutzerbild von gizzy
gizzy

Registriert seit: 3. Jun 2007
59 Beiträge
 
Delphi 2007 Enterprise
 
#4

Re: FindWindow: Alle Handles filtern

  Alt 20. Feb 2008, 14:03
Danke soweit.
Habe folgende Funktion gefunden, leider verstehe ich sie nicht. Vielleicht könnte mir jemand ein Anwendungs Beispiel zeigen

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
EnumWindows(@EnumWinProc, 0); //Fehler: Variable erforderlich
end;

function TForm1.EnumWinProc(Wnd: THandle; LParam: LongInt): Boolean; stdcall;
var
 WinCaption : string;
 Len: integer;
begin
 Result := True;
 Len := GetWindowTextLength(Wnd);
 SetLength(WinCaption, Len);
 GetWindowText(Wnd, PChar(WinCaption), Len+1);
 if Trim(WinCaption) <> 'then
   Form1.Listbox1.Items.Add(Format('%.6x : %s', [Wnd, WinCaption]));
end;
Quelle

Viele Grüße
David
  Mit Zitat antworten Zitat