void Cloadscript::load(CString strDir)
{
if(strDir == "")
{
return;
}
char *m=(LPSTR)(LPCTSTR)strDir;
char fname[100];
_splitpath( m, NULL, NULL, fname, NULL );
CString buf=fname;
if (buf=="一键挂机")
{
return;
}
buf="+"+buf;
HTREEITEM h=m_tree_loaddir.InsertItem(buf,0,1);
CFileFind ff;
CString szDir = strDir,strPath;
if(szDir.Right(1) != "//")
szDir += "//";
szDir += "*.*";
BOOL res = ff.FindFile(szDir);
while( res )
{
res = ff.FindNextFile();
strPath = ff.GetFilePath();
CString filename=ff.GetFileName();
if(ff.IsDirectory() && !ff.IsDots())
{
load(strPath);
}
else if(!ff.IsDirectory() && !ff.IsDots())
{
//CString name=m_cfg_FilePathName+"脚本//";
name.Replace("","//");
strPath.Replace(name,"");
m_tree_loaddir.InsertItem(strPath,h);
}
}
ff.Close();
}