Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

How to tell if a file or a folder could be placed into the Recycle Bin?

$
0
0
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:

Quote:

Are you sure you want to permanently delete this folder?
Name:  1.png
Views: 59
Size:  16.5 KB

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?
Attached Images
 

Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles


Pregnant woman released on bail


Waves Complete v2019.02.14 Incl Emulator-R2R


It’s Kind of a Funny Story 2010 Dual Audio 720p BRRip [Hindi – English] ESubs


CalCen


Serial child killer David Threinen’s reign of terror


Pumped up UDA chief ordered teen to be shot


MCGEE, SAMUEL O., DECEASED, OF...


Alison Moyet - Alf (Deluxe Edition) (2016) flac


Shawn Ogrodnik


WordPress: Reverse Shell



Latest Images