SHGFI_SYSICONINDEX or SHGFI_SMALLICON); if SysImageList <>0 then begin ListViewl.Smallimages.Handle := SysImageList; ListViewl.Smallimages.ShareImaoes := TRUE; end; end; Birinchi ikki qatorda kichik va katta ikonachalar ro‘yxati yaratiladi.
Katta ikonalar ro‘yxatini hosil qilish uchun SHGetFilelnfo funksiyasi
chaqiriladi.
Endi OnShowhodisasi uchun protsedura kiritamiz. Bu protsedurada
joriy direktoriyadan hamma fayllami o‘quvchi AddFile protsedurasini
yaratamiz.
Procedure TForml.FormShow(Sender: TObject); begin AddFile(Editl.Text+'*.*',faAnyFile) end; Bu protsedura quyidagi ko‘rinishga ega:
Function TForml.AddFile(FileMask: string; FFileAttr:DWORD): Boolean; var Shlnfo: TSHFilelnfo; attributes: string; FileName: string; hFindFile: THandle; SearchRec: TSearchRec; function AttrStr(Attr: integer): string; begin Result if (FILE_ATTRIBUTE_DIRECTORY andAttr) > 0 then Result := Result + "; if (FILE_ATTRIBUTE_ARCHIVE and Attr) > 0 then
208
Result := Result + 'A'; if (FILE_ATTRIBUTE_READONLY andAttr) > 0 then Result := Result + 'R'; if (FILE_AITRIBUTE_HIDDEN andAttr) > 0 then Result := Result + 'H'; if (FILE_ATTRIBUTE_SYSTEM and Attr) > 0 then Result := Result + 'S'; end; begin ListViewl.Items.BeginUpdate; ListViewl.Items. Clear; Result := False; hFindFile := FindFirst(FileMask, FFileAttr, SearchRec); ifhFindFile <> INVALID_HANDLE_VALUE then