void FileProperties::Load() { if(!loaded) { loaded=true; smallIcon=GetFileIcon(fullPath, SHGFI_SMALLICON | SHGFI_ICON); bigIcon=GetFileIcon(fullPath, SHGFI_LARGEICON | SHGFI_ICON); displayName=GetFileDisplayName(fullPath); typeName=GetFileTypeName(fullPath); lastWriteTime=GetFileLastWriteTime(fullPath); size=GetFileSize(fullPath); } }
// Fill all information about a directory or a file. FOREACH(WString, file, files) { Ptr<list::ListViewItem> item=new list::ListViewItem; WString fullPath=path+L"\\"+file; // Get large icon. item->largeImage=GetFileIcon(fullPath, SHGFI_LARGEICON | SHGFI_ICON); // Get small icon. item->smallImage=GetFileIcon(fullPath, SHGFI_SMALLICON | SHGFI_ICON); // Get display name item->text=GetFileDisplayName(fullPath); // Get type name item->subItems.Add(GetFileTypeName(fullPath)); // Get last write time item->subItems.Add(FileTimeToString(GetFileLastWriteTime(fullPath))); // Get file size item->subItems.Add(FileSizeToString(GetFileSize(fullPath))); listView->GetItems().Add(item); }