BOOL DeleteFolder(LPCTSTR lpszPath)
{
SHFILEOPSTRUCT FileOp;
ZeroMemory((void*)&FileOp,sizeof(SHFILEOPSTRUCT));
FileOp.fFlags = FOF_NOCONFIRMATION;
FileOp.hNameMappings = NULL;
FileOp.hwnd = NULL;
FileOp.lpszProgressTitle = NULL;
FileOp.pFrom = lpszPath;
FileOp.pTo = NULL;
FileOp.wFunc = FO_DELETE;
return SHFileOperation(&FileOp) == 0;
}
- BOOL CopyFolder(LPCTSTR lpszFromPath,LPCTSTR lpszToPath)
- {
- SHFILEOPSTRUCT FileOp;
- ZeroMemory((void*)&FileOp,sizeof(SHFILEOPSTRUCT));
- FileOp.fFlags = FOF_NOCONFIRMATION ;
- FileOp.hNameMappings = NULL;
- FileOp.hwnd = NULL;
- FileOp.lpszProgressTitle = NULL;
- FileOp.pFrom = lpszFromPath;
- FileOp.pTo = lpszToPath;
- FileOp.wFunc = FO_COPY;
- return SHFileOperation(&FileOp) == 0;
- }
时间: 2024-11-08 11:56:03