TFileListBox and Directories lazarus / 8-Other ---------------------------------------------------------------------- Zomis · 2007-02-06 19:37 I'm using Lazarus 0.9.20 in Windows Even though I've set all TFileListBox.FileType properties to true, it doesn't show any directories! I've searched the forum and I found this topic: http://www.lazarus.fre epascal.org/index.php?name=PNphpBB2&file=viewtopic&t=1185 So I thought that maybe I could find hidden directories, but nope. Didn't find any hidden ones either. How to get all the subdirectories contained in a directory? ---------------------------------------------------------------------- Danail · 2007-02-06 21:14 did you try using the directory listbox component, there is also a drive combobox for choosing the drives. ---------------------------------------------------------------------- Zomis · 2007-02-06 21:18 I haven't found any kind of directory listbox in Lazarus, but I know that it exists one in Delphi. But now I'm using Lazarus and not Delphi... And if it's portable or avalible as a package or such, I hope it's possible to get the subdirectories of a directory with it using some code and for example, output all the subdirectory names to a Memo ---------------------------------------------------------------------- RudieD · 2007-02-07 15:23 Why don't you use FindFirst, FindNext, CloseFind ? ---------------------------------------------------------------------- Zomis · 2007-02-07 16:08 1. Didn't think about those functions. 2. Now when I tried, I don't seem to be able to get it to work correctly. I get the TSearchRec but the Name property is set to the directory and not the file. And I don't know what do to with the FindHandle property. Is there somehow I can get the name out from it? ---------------------------------------------------------------------- RudieD · 2007-02-07 18:26 Isn't that maybe the directory record that you are looking at ? In that case just do a FindNext. ---------------------------------------------------------------------- Zomis · 2007-02-07 18:37 I did many 3 findnexts, all of them returned D:\. But I searched for FindFirst in the forum and I found out that you need to use it with a wildcard at the end to get some results. Silly me... So I think I know how to do now But it seems like somehow it always finds all files, not only directories. Even though I use Code: [Select] var   S: TSearchRec;   I: Integer; begin   I:=FindFirst('D:\*', faDirectory, S);   while I = 0 do   begin     if DirectoryExists(S.Name) then      SynEdit1.Lines.Add(S.Name)     else SynEdit1.Lines.Add(IntToStr(GetFileAttributes(PChar(S.Name))) + ': ' + S.Name);     I:=FindNext(S);   end;   SysUtils.FindClose(S); end; I notice that all GetFileAttributes calls return 4294967295 (which equals $ffffffff = High(Longword)) But luckily, I have a way to work around that (checking if a specific subfile exists, which I need for my program anyways) Thanks for your help!!