SysUtils.FindFirst
cannot find all files with extension ~1~
and other strange file extensions, for example: Unit1.dfm.~1~
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TSearchRec sr;
int iAttributes = 0;
StringGrid1->RowCount = 1;
iAttributes |= faReadOnly;
iAttributes |= faHidden;
iAttributes |= faSysFile;
iAttributes |= faVolumeID;
iAttributes |= faDirectory;
iAttributes |= faArchive;
iAttributes |= faAnyFile;
StringGrid1->RowCount = 0;
if (FindFirst(Edit1->Text, iAttributes, sr) == 0)
{
do
{
if ((sr.Attr & iAttributes) == sr.Attr)
{
StringGrid1->RowCount = StringGrid1->RowCount + 1;
StringGrid1->Cells[1][StringGrid1->RowCount-1] = sr.Name;
StringGrid1->Cells[2][StringGrid1->RowCount-1] = IntToStr(sr.Size);
}
} while (FindNext(sr) == 0);
FindClose(sr);
}
}
How to make this code to find all files, with any extension ?