显示文件下的子文件
void TCFindFile(CString FilePath,CListCtrl& m_dir_tree)
{
OutputDebugString("TCFindFile");
CFileFind find;
CString Dir = FilePath+"*.*";
BOOL res =find.FindFile(Dir);
//OutputDebugString(Dir);
if (!res)
{
OutputDebugString("DiskScanOver!");
return;
}
int i =1;
while(res)
{
CString Filename;
CString tmp; ////文件路径
res = find.FindNextFile();
if (find.IsDirectory() && !find.IsDots())//目录是文件夹
{
Filename = find.GetFileName();
tmp = Dir.Left(Dir.GetLength() - 3) + Filename;
tmp+="//";
int nIndex;
TCHAR Path[MAX_PATH+1];//TCHAR取代char MAX_PATH最长路径
nIndex=m_dir_tree.InsertItem(i,Filename);
GetWindowsDirectory(Path,MAX_PATH);
m_dir_tree.SetItemText(nIndex, 1, Path );
if (Filename == "Foxmail")
{
//执行后续操作
OutputDebugString(tmp);
OutputDebugString("GetPWDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD");
return;
}
}
}
i++;
}