BOOL MyFileOperations :: DeleteImageDirectory(Cstring strDirectory)
{
Cstring strDirectoryName;
SHFILEOPSTRUCT shFile;
int nResult = 0;
strDirectoryName = strDirectory;
ZeroMemory (&shFile, sizeof(SHFILEOPSTRUCT));
shFile.wFunc = FO_DELETE;
strDirectoryName = strDirectoryName +_T('\0\0');
shFile.pFrom = strDirectoryName.c_str();
shFile.pTo = NULL;
shFile.fFlags = FOF_SILENT + FOF_NOCONFIRMATION;
nResult = SHFileOperation(&shFile);
if(nResult != 0)
{
MsgBox("Error");
return FALSE;
}
else
{
MsgBox("Sucess");
}
return TRUE;
}
{
Cstring strDirectoryName;
SHFILEOPSTRUCT shFile;
int nResult = 0;
strDirectoryName = strDirectory;
ZeroMemory (&shFile, sizeof(SHFILEOPSTRUCT));
shFile.wFunc = FO_DELETE;
strDirectoryName = strDirectoryName +_T('\0\0');
shFile.pFrom = strDirectoryName.c_str();
shFile.pTo = NULL;
shFile.fFlags = FOF_SILENT + FOF_NOCONFIRMATION;
nResult = SHFileOperation(&shFile);
if(nResult != 0)
{
MsgBox("Error");
return FALSE;
}
else
{
MsgBox("Sucess");
}
return TRUE;
}