mfc移动文件夹

     SHFILEOPSTRUCT FileOp;
        ZeroMemory((void*)&FileOp,sizeof(SHFILEOPSTRUCT));
        FileOp.fFlags = FOF_NOCONFIRMATION ;
        FileOp.hNameMappings = NULL;
        FileOp.hwnd = NULL;
        FileOp.lpszProgressTitle = NULL;
        FileOp.pFrom = oldBuf;//源地址
        FileOp.pTo = newBuf;//目的地址
        FileOp.wFunc = FO_MOVE;
        int ret = SHFileOperation(&FileOp);
        if(0==ret)
        {
AfxMessageBox(_T("上传成功")); } 注意:两个地址最后两个字节必须为\0 oldBuf[oldPath.size()]='\0'; oldBuf[oldPath.size()+1]='\0'; newBuf[newPath.size()]='\0'; newBuf[newPath.size()+1]='\0';

 

posted @ 2019-05-09 10:25  朱小勇  阅读(354)  评论(0编辑  收藏  举报