Deleting files to Recycle bin
Moderator: Moderators
Deleting files to Recycle bin
Hello,
I've been looking at bug 1048 in the Bugzilla and was wondering a bit on howto attack it.
Is SHFileOperation the way to go or is there another and better way to do it?
Regards
I've been looking at bug 1048 in the Bugzilla and was wondering a bit on howto attack it.
Is SHFileOperation the way to go or is there another and better way to do it?
Regards
"Nothing really happens fast. Everything happens at such a rate that by the time it happens, it all seems normal."
SHFileOperation should do it
i also took a look at this feature idea and i was thinking of showing a whole Shell menu... something like this: http://www.codeproject.com/shell/shellcontextmenu.asp
this way, you get the "real" Windows behavior about deleting, renaming, etc.
i also took a look at this feature idea and i was thinking of showing a whole Shell menu... something like this: http://www.codeproject.com/shell/shellcontextmenu.asp
this way, you get the "real" Windows behavior about deleting, renaming, etc.
-
- Forum Moderator
- Posts: 1420
- Joined: 2003-04-22 14:37
Heh, I've made a (ugly hack) patch now that actually works. It "deletes" the files/dirs to Recycle bin from Finished Downloads Frame.
Maybe the next step is a complete Shell ContextMenu...
what do you say poy?
Maybe the next step is a complete Shell ContextMenu...
what do you say poy?
"Nothing really happens fast. Everything happens at such a rate that by the time it happens, it all seems normal."
i say i'm gonna try somethingGuitarm wrote:Heh, I've made a (ugly hack) patch now that actually works. It "deletes" the files/dirs to Recycle bin from Finished Downloads Frame.
Maybe the next step is a complete Shell ContextMenu...
what do you say poy?
and about your patch, do you also get a confirm dialog box? like "are you sure". you may also use WinUtil::isShift() to see if the user has pressed "shift"; if he has, the file should be completely removed (not through the recycle bin).
Strange, I didn't get your answer to my mail. Oh, well.
No, no confirmation, but that can be easily arranged
I mailed with arne and If I understood him correctly he thinks ShellMenu is the best alternative, but with an option to turn it off and use "standard" menu.
I look forward to see, and try, your patch!. I'll tinker away here too but you're probably faster than me so...
No, no confirmation, but that can be easily arranged
I mailed with arne and If I understood him correctly he thinks ShellMenu is the best alternative, but with an option to turn it off and use "standard" menu.
I look forward to see, and try, your patch!. I'll tinker away here too but you're probably faster than me so...
"Nothing really happens fast. Everything happens at such a rate that by the time it happens, it all seems normal."
http://dcpp.net/bugzilla/show_bug.cgi?id=1063
i've not added any option, but it should be easy, because the shell menu is added in an if(1 item selected) block. so it would just need to be changed to if(1 item && BOOLSETTING(...))
[edit: however, the "standard" menu is still there, it's inserted at the beginning of the shell menu ]
i'm not sure about everything, so please try it!
oh and sorry for the e-mail, i'm using a "trash" e-mail here so i fear i can't be reached anywhere else but here or on the public dev hub...
i've not added any option, but it should be easy, because the shell menu is added in an if(1 item selected) block. so it would just need to be changed to if(1 item && BOOLSETTING(...))
[edit: however, the "standard" menu is still there, it's inserted at the beginning of the shell menu ]
i'm not sure about everything, so please try it!
oh and sorry for the e-mail, i'm using a "trash" e-mail here so i fear i can't be reached anywhere else but here or on the public dev hub...
Nice
I've just patched, compiled and started up. I'll come back with a review...
Whoops...try to remove a file ("new" remove) -> it does remove the file but not the list item ->
I've just patched, compiled and started up. I'll come back with a review...
Whoops...try to remove a file ("new" remove) -> it does remove the file but not the list item ->
Code: Select all
Code: c0000005
Version: 0.696
Major: 5
Minor: 1
Build: 2600
SP: 2
Type: 1
Time: 2006-09-28 02:03:26
TTH: AF6TRFOHY7S3NAS5AFUTABYJ5K3WYXMMP37CBOQ
c:\dcpp\svn\dcplusplus\trunk\windows\shellcontextmenu.cpp(72): CShellContextMenu::SetPath
c:\dcpp\svn\dcplusplus\trunk\windows\finishedframebase.h(206): FinishedFrameBase<FinishedULFrame=0x0000007B,152=0x00AE02C0,1126>::onContextMenu
c:\dcpp\svn\dcplusplus\trunk\windows\finishedframebase.h(50): FinishedFrameBase<FinishedFrame=0x009602CE,151=0x0000007B,1091>::ProcessWindowMessage
c:\program\microsoft visual studio .net 2003\vc7\atlmfc\include\atlwin.h(3017): ATL::CWindowImplBaseT<WTL::CMDIWindow=0x00E3BA18,ATL::CWinTraits<1456406528=0x0000007B,64> >::WindowProc
"Nothing really happens fast. Everything happens at such a rate that by the time it happens, it all seems normal."
thanks for trying!
i don't manage to reproduce what you get
when i do a remove (the old remove that's already in the current context menu), it removes fine... same with many items at a time.
what do you call "new" remove? i've not added any "remove"
since the bug seems to have appeared in CShellContextMenu::SetPath, completely in the middle of trying to get PIDLs corresponding to the path, it may be a path issue. does it also happen with the same path you tried, without remove? and if it does, what's so special in this path then...? thanks
i don't manage to reproduce what you get
when i do a remove (the old remove that's already in the current context menu), it removes fine... same with many items at a time.
what do you call "new" remove? i've not added any "remove"
since the bug seems to have appeared in CShellContextMenu::SetPath, completely in the middle of trying to get PIDLs corresponding to the path, it may be a path issue. does it also happen with the same path you tried, without remove? and if it does, what's so special in this path then...? thanks
Ah, ok. I mean the ( I have a swedish XP here - My girlfriends comp ) second alternative from the bottom, in swedish it's "ta bort" but I don't even know where you're from and what language you use *lol*. But second from the bottom (second from properties). You get a dialog "Confirm deletion of file" or something similar...
Yes, the original remove works fine here too, no problemo
Yes, the original remove works fine here too, no problemo
"Nothing really happens fast. Everything happens at such a rate that by the time it happens, it all seems normal."
you are right, thanks! fixed
actually, it happens also if you have moved/deleted the file from somewhere else (for instance from the windows explorer). the SetPath() function couldn't associate PIDLs to the path, because the path doesn't exist...
oh and here it's called "Supprimer" [french]
it must be "Delete" in english, which would differentiate this command from the "Remove" which is in the "standard" menu.
actually, it happens also if you have moved/deleted the file from somewhere else (for instance from the windows explorer). the SetPath() function couldn't associate PIDLs to the path, because the path doesn't exist...
oh and here it's called "Supprimer" [french]
it must be "Delete" in english, which would differentiate this command from the "Remove" which is in the "standard" menu.
Yes you're right, I should've used "Delete" instead, my mistakepoy wrote:it must be "Delete" in english, which would differentiate this command from the "Remove" which is in the "standard" menu.
If I'll get the time I'll try that new patch aswell and I hope that the copyright/wrong issue can be solved.
Good coding btw
"Nothing really happens fast. Everything happens at such a rate that by the time it happens, it all seems normal."