在ondata事件里:
if (Item.Index > FIDList.Count) then Exit;
with ShellItem(Item.Index)^ do
begin
Item.Caption := DisplayName;
Item.ImageIndex := ImageIndex;
if ListView.ViewStyle <> vsReport then Exit;
if not IsFolder(FIShellFolder, ID) then
Item.SubItems.Add(Format('%dKB', [Size]))
else
Item.SubItems.Add('');
Item.SubItems.Add(TypeName);
try
Item.SubItems.Add(ModDate);
except
end;
if Bool(Attributes and FILE_ATTRIBUTE_READONLY) then Attrs := Attrs + 'R';
if Bool(Attributes and FILE_ATTRIBUTE_HIDDEN) then Attrs := Attrs + 'H';
if Bool(Attributes and FILE_ATTRIBUTE_SYSTEM) then Attrs := Attrs + 'S';
if Bool(Attributes and FILE_ATTRIBUTE_ARCHIVE) then Attrs := Attrs + 'A';
end;
Item.SubItems.Add(Attrs);