Result := False;
hFindFile := FindFirst(FileMask, FFileAttr, SearchRec);
if hFindFile <> INVALID_HANDLE_VALUE then
try
repeat
with SearchRec.FindData do
begin
if (SearchRec.Name = '
.
') or (SearchRec.Name = '
..
') or
(SearchRec.Name = '') then continue;
FileName := SlashSep(Edit1.Text, SearchRec.Name);
SHGetFileInfo(PChar(FileName), 0, ShInfo, SizeOf(ShInfo),
SHGFI_TYPENAME or SHGFI_SYSICONINDEX);
Attributes := AttrStr(dwFileAttributes);
with ListView1.Items.Add do
begin
Caption := SearchRec.Name;
ImageIndex := ShInfo.iIcon;
SubItems.Add(IntToStr(SearchRec.Size));
SubItems.Add((ShInfo.szTypeName));
SubItems.Add(FileTimeToDateTimeStr(ftLastWriteTime));
SubItems.Add(attributes);
SubItems.Add(Edit1.Text + cFileName);
if (FILE_ATTRIBUTE_DIRECTORY and dwFileAttributes) > 0 then
SubItems.Add('
dir
Do'stlaringiz bilan baham: |