-
May 18th, 2014, 03:24 PM
#1
How to tell if a file or a folder could be placed into the Recycle Bin?
Say, I have the "K:\test del USB" folder. Then I do the following:
Code:
SHFILEOPSTRUCT sfo = {0};
sfo.wFunc = FO_DELETE;
sfo.pFrom = L"K:\\test del USB\0";
sfo.fFlags = FOF_ALLOWUNDO |
FOF_SILENT | /*FOF_NOCONFIRMATION |*/ FOF_NOERRORUI | FOF_NOCONFIRMMKDIR |
FOF_WANTNUKEWARNING;
int res = SHFileOperation(&sfo);
BOOL bFullSuccess = res == 0 && !sfo.fAnyOperationsAborted;
So when I run it, the SHFileOperation API shows this warning:
Are you sure you want to permanently delete this folder?
If the end-user clicks "No", SHFileOperation return 0x4c7, which I believe is ERROR_CANCELLED.
My question is, if I don't need any UI, how can I know that my file/folder will be permanently deleted vs. placed into the Recycle Bin?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|