I'm quite amazed by Explorer++.
My own sw can delete files to the recycle bin. But it fails if path+name are longer than 256 chars. Error code 0x7c (DE_INVALIDFILES). I checked your source code, but didn't find anything special. You're using SHFileOperation, just like I do.
Why does it work in Explorer++? What magic did you use?
Please help me!
Tom
Delete to recycle bin with long filenames - How do you do it
-
- Site Admin
- Posts: 936
- Joined: Sat Apr 18, 2009 1:46 am
Re: Delete to recycle bin with long filenames - How do you d
Hi Tom,
I can't say that it's doing anything special! Are you sure your filename list is double-null terminated?
I can't say that it's doing anything special! Are you sure your filename list is double-null terminated?
Re: Delete to recycle bin with long filenames - How do you d
Hi David,
thanks for your reply. Yes, I'm quite sure. And for "normal" filenames my code works nicely.
Here it is:
(I know, hard-coding the buffer isn't perfect. But it's not the problem here...
Any ideas?
Is there anything that can be enabled in the manifest file or a Windows API function to tell Window that this program can handle long filenames?
thanks for your reply. Yes, I'm quite sure. And for "normal" filenames my code works nicely.
Here it is:
Code: Select all
char Buffer[2048+4];
strncpy_s (Buffer, 2048+4, filename, 2048);
Buffer[strlen(Buffer)+1]=0;
SHFILEOPSTRUCT s;
s.hwnd = NULL;
s.wFunc = FO_DELETE;
s.pFrom = Buffer;
s.pTo = NULL;
s.fFlags = FOF_ALLOWUNDO | (bConfirm?0:FOF_NOCONFIRMATION) | FOF_SILENT|FOF_NOERRORUI;
s.fAnyOperationsAborted = false;
s.hNameMappings = NULL;
s.lpszProgressTitle = NULL;
int rc = SHFileOperation(&s);
return (rc==0);
Any ideas?
Is there anything that can be enabled in the manifest file or a Windows API function to tell Window that this program can handle long filenames?