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  }

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

        

 

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

      最终结果显示

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

        

 

posted @ 2018-01-27 10:31  小油菜1  阅读(194)  评论(0编辑  收藏  举报