typedef BOOL (* PROCESS_FILE_FUNCTION) (LPCTSTR filename); above PROCESS_FILE_FUNCTION is a function pointer, the function processing file called filename, if the function returns FALSE, the ProcessDirectory quit immediately, look no further void ProcessDirectory (LPCTSTR dirname , PROCESS_FILE_FUNCTION PROC) {CStringArray Dirs; CString Searchname; cfileFind Find; DIRS.ADD (DIRNAME); BOOL BRET; While (DIRS.GETSIZE ()> 0) {searchname = DIRS [0] "//*.*"; DIRS.Removeat (0); Bret = find.findfile (searchname, 0); if (! BRET) Continue; Do {Bret = Find.FindNextFile (); if (Find.isdots ()) {// ignore. .} {DIRS.ADD ()) {DIRS.ADD (Find.GetFilePath ()); Continue;} else {if (! Proc (Find.getFilePath ())) {return;}}} while Bret);}}