如题

解决方案 »

  1.   

    调用API SHFileOperation(...),能进行文件拷贝,删除,移动等操作,
    同时可以让你控制是否显示相关对话框(进度条,动画,确认等)详细情况,请参考MSDN
      

  2.   

    http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=86
      

  3.   

    IProgressDialog,参考:
    例子参考:http://www.codeproject.com/miscctrl/iprogressdialog.asp
      

  4.   

    CString strSourcePath = BrowseForFolder("请选择备份数据目录",BIF_RETURNONLYFSDIRS);if(strSourcePath.IsEmpty())
    {
    GetDlgItem(IDC_RESTORE_DATABASE)->EnableWindow(TRUE);
    return;
    }
    strSourcePath += "\\*.*";CString strTargetPath;
    GetModuleFileName(NULL, strTargetPath.GetBufferSetLength(_MAX_PATH), _MAX_PATH);
    strTargetPath.ReleaseBuffer();int nFindPos = strTargetPath.ReverseFind('\\');
    if(nFindPos != -1)
    {
    strTargetPath = strTargetPath.Left(nFindPos);
    }
    strTargetPath = //你要拷贝到的新目录    SHFILEOPSTRUCT FileOperate;
    ZeroMemory(&FileOperate,sizeof(FileOperate));    FileOperate.hwnd = NULL;
        FileOperate.wFunc = FO_COPY;char szSourcePath[255] = "\0";
    strcpy(szSourcePath,(LPTSTR)(LPCTSTR)strSourcePath);    FileOperate.pFrom = szSourcePath;
        FileOperate.pTo = strTargetPath;    FileOperate.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_ALLOWUNDO;    if(!SHFileOperation(&FileOperate))
    {
    AfxMessageBox("备份数据已恢复!");
    }
      

  5.   

    考完了最好加上一句SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH, (LPCVOID) strTargetPath, 0);