FindFirst returns folders in English - Delphi

Good morning ... I am listing all the files in the directory ... But I ran into the following problem ... When the folders go all in English ... But the operating system is the Ministry of Defense for the Portuguese ... How to list it according to operating system language:

Example: Program Files (EN) → Arquivos de Programa (PT)

if FindFirst (directory + '*. *', faAnyFile, search_rec) = 0 then
       begin
         repeat
           Form4.ListView1.Items.Add.Caption: = search_rec.Name;
             lista.Add (search_rec.Name);
         Until FindNext (search_rec) <> 0;

         FindClose (search_rec);
       end;

      

+3


source to share


1 answer


Ok Portuguese:



SHGetFileInfo(PChar(strPath + SearchRec.Name), 0, FileInfo,
                  SizeOf(FileInfo), SHGFI_DISPLAYNAME);
                Listitem.Caption := FileInfo.szDisplayName;

      

+1


source







All Articles