14)显示树状目录

Posted 小油菜123

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了14)显示树状目录相关的知识,希望对你有一定的参考价值。

1)接着之前的代码

2)最终结果展示:

        

 

3)基本步骤:

      

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      

 1 // CTree 消息处理程序
 2 void CTree::InsertOnePage(HTREEITEM hitem,CString cpath)
 3  {
 4      
 5      if(hitem==0||cpath==L"")
 6      {
 7         return ;
 8      }
 9      CFileFind cfile;
10     BOOL flag= cfile.FindFile(cpath+L"\\\\*.*");
11     while(flag)
12     {
13         flag=cfile.FindNextFile();
14         if(cfile.IsDots()==true)
15         {
16             continue;
17         }
18         CString stName=cfile.GetFileName();
19         this->InsertItem(stName,hitem);
20         
21     }
22 
23  }

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        

 

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~·

      最终结果显示

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        

 

以上是关于14)显示树状目录的主要内容,如果未能解决你的问题,请参考以下文章