1. 程式人生 > >14)顯示樹狀目錄

14)顯示樹狀目錄

turn bool 目錄 con mage return continue info void

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)顯示樹狀目錄