Forum: Sonstige Fragen zu Delphi
Delphi
by toms,
13. Jan 2009
procedure ListDirectory(Strings: TStrings; const Path: string);
var
S: TSearchRec;
begin
if FindFirst(Path, faDirectory, S) = 0 then
begin
repeat
if ((S.Attr and faDirectory) = faDirectory) and
(s.Name <> '.') and (s.Name <> '..') then
Strings.Add(S.Name);
Forum: Sonstige Fragen zu Delphi
Delphi
by toms,
13. Jan 2009
Edit: i sollte vom Typ Integer sein und nicht Word. Probier's nochmals.
Forum: Sonstige Fragen zu Delphi
Delphi
by toms,
13. Jan 2009
Hallo
Das geht z.B mit der LB_DIR Nachricht.
Flexibler bist du jedoch mit FindFirst, FindNext etc.
procedure ListDirectories(LB: TListBox; Path: PChar);
var
i: Integer;
begin
with LB do