|
질문이 .. 어떻게 하셨다는건지 잘 모르겠느데요...제가 추측한대로 답변드려봅니다.
아래는 FindFirst 빌더의 예제입니다. check박스부분은 제가 지웠구요.
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);
}
}
여기에 Edit1->Text 에 *.pcx 넣고 돌리고 또 *.bmp 넣고 돌리고 그러신다는거지요,?
속도차이는 어떨지 모르지만
저는 Edit1->Text 에 *.* 를 넣고 sr.Name 의 확장자를 검사해서 원하는 화일만 걸러내는데요.
원하시는 답변인지 모르겠네요. ^^ㅋ
DoyongID 님이 쓰신 글 :
: *.bmp;*.pcx;*.jpg 를 하위폴더까지 검색해서 파일 리스트를 얻어오는 프로그램을 짜려고 하는데요..
:
: 위의 확장자를 한꺼번에 검사하는 방법은 없을까요?
:
: 지금은 bmp파일을 다 찾고 나서 다시 처음부터 pcx파일 찾고, 다시 처음부터 jpg 찾고... 그런 식으로 하고 있습니다..
|