16,550
社区成员
发帖
与我相关
我的任务
分享
wchar_t * szSourcePath = _T("J:\\testFrom\\*.*\0");
wchar_t * szDestinationPath = _T("J:\\testTo\\\0");
SHFILEOPSTRUCT FileOP; //SHFILEOPSTRUCT声明
ZeroMemory(&FileOP, sizeof(FileOP));
//SHFILEOPSTRUCT成员赋值
FileOP.hwnd = AfxGetApp()->m_pMainWnd->m_hWnd;
FileOP.fFlags = FOF_SILENT;
FileOP.wFunc = FO_COPY;
FileOP.pFrom = szSourcePath;
FileOP.pTo = szDestinationPath;
FileOP.fAnyOperationsAborted = FALSE; //
FileOP.hNameMappings = NULL;
FileOP.lpszProgressTitle = NULL;
//SHFILEOPSTRUCT成员赋值结束
int msg = SHFileOperation(&FileOP);//执行复制操作
if(msg==0)
AfxMessageBox(_T("复制完成"));
else
AfxMessageBox(_T("复制失败!!!"));