/********************************************************
函数名:CopyFolder
函数功能:文件夹复制
输入参数:lpszFromPath,lpszFromPath
返回值:True
说明:源目录必须以'\0\0'(即连续的两个'\0')结束,不能以'\'结束
*********************************************************/
BOOL CopyFolder(TCHAR* lpszFromPath,TCHAR* lpszToPath)
{
函数名:CopyFolder
函数功能:文件夹复制
输入参数:lpszFromPath,lpszFromPath
返回值:True
说明:源目录必须以'\0\0'(即连续的两个'\0')结束,不能以'\'结束
*********************************************************/
BOOL CopyFolder(TCHAR* lpszFromPath,TCHAR* lpszToPath)
{
WCHAR NewPathFrm[MAX_PATH+2]={0};
int len=0;
wcscpy_s(NewPathFrm, (MAX_PATH+2), lpszFromPath);
int len=0;
wcscpy_s(NewPathFrm, (MAX_PATH+2), lpszFromPath);
len=wcslen(lpszFromPath);
NewPathFrm[len+1]='\0';
NewPathFrm[len+2]='\0';
NewPathFrm[len+1]='\0';
NewPathFrm[len+2]='\0';
SHFILEOPSTRUCT FileOp;
ZeroMemory((void*)&FileOp,sizeof(SHFILEOPSTRUCT));
FileOp.fFlags = FOF_NOCONFIRMATION|FOF_SILENT;
FileOp.hNameMappings = NULL;
FileOp.hwnd = NULL;
FileOp.lpszProgressTitle = NULL;
FileOp.pFrom = NewPathFrm;
FileOp.pTo = lpszToPath;
FileOp.wFunc = FO_COPY;
SHFileOperation(&FileOp);
ZeroMemory((void*)&FileOp,sizeof(SHFILEOPSTRUCT));
FileOp.fFlags = FOF_NOCONFIRMATION|FOF_SILENT;
FileOp.hNameMappings = NULL;
FileOp.hwnd = NULL;
FileOp.lpszProgressTitle = NULL;
FileOp.pFrom = NewPathFrm;
FileOp.pTo = lpszToPath;
FileOp.wFunc = FO_COPY;
SHFileOperation(&FileOp);
return TRUE;
}
}