摘要: //关于文件(夹)操作,可以参考下SHFileOperation这个外壳函数,貌似可以显示进度条。以下没有使用SHFileOperation//删除一个文件夹下的所有内容void myDeleteDirectory(CString directory_path) { CFileFind finder; CString path; path.Format("%s/*.*",directory_path); BOOL bWorking = finder.FindFile(path); while(bWorking){ bWorking = finder.FindNextFile 阅读全文
posted @ 2013-12-04 18:13 酷熊 阅读(296) 评论(0) 推荐(0) 编辑
摘要: //如果涉及到大文件的遍历(大于4GB),可以将以下代码_finddata_t换成__finddata64_t,_findfirst换成_findfirst64,_findnext换成_findnext64void dfsFolder(CString dirPath){_finddata_t FileInfo;CString tmp=dirPath;if (tmp.Right(1) != "\\")tmp += "\\";CString strfind = tmp + "*";long Handle = _findfirst(strf 阅读全文
posted @ 2013-12-04 18:10 酷熊 阅读(401) 评论(0) 推荐(0) 编辑
摘要: //选择文件CFileDialog dlg(TRUE, 0, 0, OFN_HIDEREADONLY, "文本文件|*.txt|所有文件|*.*)||",0);if (dlg.DoModal()){CString filePath=dlg.GetPathName();CString fileNameWithNoExt=dlg.GetFileTitle();}//选择文件夹版本1void CMyTestDlg::OnBnClickedButton1(){TCHAR chPath[255]; //用来存储路径的字符串CString strPath;BROWSEINFO bInf 阅读全文
posted @ 2013-12-04 18:04 酷熊 阅读(2105) 评论(0) 推荐(0) 编辑
摘要: COLORREF color=RGB(0,255,0);unsigned char r=GetRValue(color);unsigned char g=GetGValue(color);unsigned char b=GetBValue(color);-------------------------------------CColorDialog colorDialog;COLORREF color;if( colorDialog.DoModal() == IDOK ){ color = colorDialog.GetColor();}--------------------------- 阅读全文
posted @ 2013-12-04 17:33 酷熊 阅读(1761) 评论(0) 推荐(0) 编辑