var
hCurrentWindow: HWnd;
szText: array[0..254] of char;
begin
hCurrentWindow := GetWindow(Handle, GW_HWNDFIRST);
While hCurrentWindow <> 0do
begin
If GetWindowText(hCurrentWindow, @szText, 255) > 0 then
ListBox1.Items.add(Strpas(@szText));
hCurrentWindow := GetNextWindow(hCurrentWindow, GW_HWNDNEXT);
end;