procedure Klass_Name(const tl: TCustommemo);
var h: THandle;
buf: array[0..1, 0..99] of char;
sl: Tstringlist;
begin
sl := Tstringlist.create;
sl.sorted := true;
sl.Duplicates := dupIgnore;
h := findwindow(nil, nil);
while h > 0 do begin
if iswindowvisible(h) then begin
getclassname(h, buf[0], 100);
GetWindowText(h, buf[1], 100);
if string(buf[1]) <> '' then
sl.add(buf[1] + '------->' + buf[0]);
end;
h := getnextwindow(h, GW_HWNDNEXT);
end;
tl.lines := sl;
sl.free;
end;
// Beispielaufruf
procedure TForm1.Button9Click(Sender: TObject);
begin
Klass_Name(Memo1);
end;