Ok, nun habe ich selbstständig versucht, das in einer ListView umzusetzen!
function EnumWinProc(Wnd: THandle; LParam: LongInt): Boolean; stdcall;
var
WinCaption : string;
Len: integer;
i : TListItem;
begin
Result := True;
Len := GetWindowTextLength(Wnd);
SetLength(WinCaption, Len);
GetWindowText(Wnd, PChar(WinCaption), Len+1);
if Trim(WinCaption) <> '' then begin
i:= Form1.ListView1.Items.Add;
i.Caption:= WinCaption;
i.SubItems.add(inttostr(Wnd));
end;
end;
Funktioniert natürlich nicht, ist ja klar
1. Spalte: Fenstername
2. Spalte:
Handle
Wie muss ich mein Code umsetzen?
Oder muss ich das ganz anders machen mit irgendwas wie
for I:= 0 to WindowCount do begin
oder sowas?