码迷,mamicode.com
首页 > 其他好文 > 详细

shfileoperation 删除文件 FileDelete(CString strName)

时间:2015-11-16 17:12:29      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:

From:http://blog.csdn.net/lvwx369/article/details/41440883

 

注意:其中namePath 为全局变量 Cstring namePath; 
BOOL FileDelete(CString strName)
{

namePath = strName;

SHFILEOPSTRUCT FileOp;
ZeroMemory((void*)&FileOp, sizeof(SHFILEOPSTRUCT));

FileOp.fFlags = FOF_NOCONFIRMATION;
FileOp.hNameMappings = NULL;
FileOp.hwnd = NULL;
FileOp.lpszProgressTitle = NULL;
FileOp.pFrom = namePath.GetBuffer(namePath.GetLength() + 2);//
FileOp.pTo = NULL;
FileOp.wFunc = FO_DELETE;

namePath.ReleaseBuffer();

return SHFileOperation(&FileOp) == 0;


}

 

shfileoperation 删除文件 FileDelete(CString strName)

标签:

原文地址:http://www.cnblogs.com/ourran/p/4969200.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!