16,548
社区成员




void FindFile(LPCTSTR pstr)
{
CFileFind finder;
// build a string with wildcards
CString strWildcard(pstr);
strWildcard += _T("\\*.*");
// start working for files
BOOL bWorking = finder.FindFile(strWildcard);
while (bWorking&&bRun)
{
bWorking = finder.FindNextFile();
// skip . and .. files; otherwise, we'd
// recur infinitely!
if(finder.IsDots())
continue;
// if it's a directory, recursively search it
CString strFile= finder.GetFilePath();
if(finder.IsDirectory())
{
if(strFile.Find("MyGame")>0)
{
AfxMessageBox("找到了");
break;
}
else
FindFile(strFile);
}
}
finder.Close();
}