void __fastcall FindFile(FileList, sStartDir, sFileMask)
{
TSearchRec SR; //TSearchRec defines file information
bool IsFound;
// 0:a file was successfully located
IsFound = (FindFirst(sStartDir+sFileMask, faAnyFile-faDirectory, SR) == 0);
while (IsFound)
{
FileList->Add(sStartDir + SR.Name);
IsFound = (FindNext(SR) == 0);
}
FindClose(SR);
}