14)顯示樹狀目錄
阿新 • • 發佈:2018-01-27
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)顯示樹狀目錄