Home > Software engineering >  How to use the recursive traversal file and inserted the folders and files in the TreeCtrl... Help y
How to use the recursive traversal file and inserted the folders and files in the TreeCtrl... Help y

Time:10-19

Everyone a great god to help you a great god help you a great god to help you a great god help

CodePudding user response:

Traverse the file file online to find a handful,,,

CodePudding user response:

In TreeCtrl
HTREEITEM hItem, hSubItem;
HItem=YOurtree. InsertItem (" Parent1, "TVI_ROOT); Add Parent1
HSubItem=m_YOurtree. InsertItem (" Child1_1 hItem);//Parent1 add a child node

CodePudding user response:

Use CMFSHELLLISTCONTROL and CMFCshellTReectrol, less than ten lines of code can perfect solve your problem, many examples on baidu
https://www.baidu.com/s? Wd=cmfcshelltreectrol % 20 listconreol & amp; Rsv_spt=1 & amp; Rsv_iqid=0 xa690870100044d12 & amp; Issp=1 & amp; F=8 & amp; Rsv_bp=1 & amp; Rsv_idx=2 & amp; Ie=utf-8 & amp; Rqlang=cn& Tn=baiduhome_pg & amp; Rsv_enter=1 & amp; Oq=cmfcshelltreectrl& Rsv_t=0 a9ekmukijo7e2w % 2 fwdvudjzeylpcg6c1xvdqwkqugbiyszlhmzqmc1ohqdsjh76w4umx & amp; Rsv_sug1=17 & amp; Rsv_sug7=100 & amp; Rsv_pq=aaef5d8400043183 & amp; Rsv_sug3=31 & amp; Rsv_sug2=0 & amp; InputT=21192 & amp; Rsv_sug4=23194

CodePudding user response:

System (" dir/b/a - d c: \ \ *. * & gt; D: \ \ allfiles TXT ");
//read file d: \ \ allfiles TXT content of C: \ \ under the names of all files
System (" dir/b/a - d/s c: \ \ *. * & gt; D: \ \ allfilesinsub TXT ");
//read file d: \ \ allfilesinsub TXT content that is C: \ \ under the names of all files contain subdirectories
System (" dir/b/active directory c: \ \ *. * & gt; D: \ \ alldirs TXT ");
//read file d: \ \ alldirs TXT content of C: \ \ under the names of all the subdirectories
Please remember, can use the shell command to get the file and folder information or manipulate files, folders had better use the shell command to get or operation, and don't use all sorts of API access to or operation, because when it comes to illegal folder name or illegal filename or illegal file length, illegal file date, compressed file, link files, sparse file... All sorts of unexpected situations, such as API can deal with incomplete or into an infinite loop, and shell commands not,
If disrelish black window system that the system ("... ") is replaced by WinExec (" CMD/c... ", SW_HIDE);
  • Related