用CFileFind类进行搜索。
下面是一个例子。。。。
void C皮肤Dlg::RecurseFile(CString strDir)
{
CFileFind Filefinder;
strDir+=_T("\\*.*");
BOOL bWorking=Filefinder.FindFile(strDir);
while(bWorking)
{
bWorking=Filefinder.FindNextFile();
if (Filefinder.IsDots())
continue;
if (Filefinder.IsDirectory())
continue;
if (Filefinder.IsArchived())
{
CString strPath=Filefinder.GetFileName();
if(strPath.ReverseFind('.jpg')!=NULL||strPath.ReverseFind('.png')!=NULL||strPath.ReverseFind('.bmp')!=NULL)
{