Page 2 of 5
Posted: 26 Sep 2005 20:48
by admin
That HELPED!! 
Took me an hour of head scratching until I saw it: accessing the Data object in the OLEDragOver event will f*** up
the zip extraction magic! I don't think this is documented anywhere. Anyway: problem solved! (And a free license for jacky

)
Posted: 26 Sep 2005 21:28
by JustinF
I'm having some problems with this. I'm using WinRAR and trying to drag a file out of a .zip file into a directory in Tracker. If there is a file selected in the listview part of Tracker, that file gets copied to whatever directory I'm dragging to instead of the file I want to extract from the .zip. If no file is selected, nothing happens.
If I use AlZip to drag files out of, I get the following message box error and no files get copied:
Code: Select all
---------------------------
Error Copying File or Folder
---------------------------
Cannot copy file: Cannot read from the source file or disk.
---------------------------
OK
---------------------------
I
really appreciate you looking into this drag-n-drop stuff...once we get it working, it'll be very nice.
Posted: 26 Sep 2005 21:50
by admin
Oh, you are dropping onto the tree view... I was so enthusiastically experimenting with the list view that I forgot to update the tree view code

... check out the next upload...
Posted: 26 Sep 2005 22:00
by JustinF
admin wrote:Oh, you are dropping onto the tree view... I was so enthusiastically experimenting with the list view that I forgot to update the tree view code

... check out the next upload...
Actually, it doesn't matter if I drop on the treeview or the listview, I get the same behavior.

Posted: 26 Sep 2005 22:19
by admin
JustinF wrote:admin wrote:Oh, you are dropping onto the tree view... I was so enthusiastically experimenting with the list view that I forgot to update the tree view code

... check out the next upload...
Actually, it doesn't matter if I drop on the treeview or the listview, I get the same behavior.

Oh.
You tried only WinRar, right?
Posted: 26 Sep 2005 22:23
by JustinF
admin wrote:You tried only WinRar, right?
I tried WinRAR and
AlZip. AlZip gives me the "Cannot copy file..." error I posted above. I will install WinZip here in just a second and see what happens.
Posted: 26 Sep 2005 22:30
by JustinF
Ok, WinZip 10 seems to work fine if I drop the files on the listview. If I drop on the treeview I get the following message box:
Code: Select all
---------------------------
Error Moving File or Folder
---------------------------
Cannot move file: Cannot read from the source file or disk.
---------------------------
OK
---------------------------
Posted: 26 Sep 2005 23:04
by jacky
JustinF wrote: WinZip 10 seems to work fine if I drop the files on the listview. If I drop on the treeview I get the following message box:
Cannot move file: Cannot read from the source file or disk.
Same here. But with WinRAR it's quite different.
Dropping on the listview will not do anything is no file is selected, or I'll get an error (
Cannot copy [selected_filename]: source & dest are the same.)
On the treeview it will copy the selected file if there's one, or do nothing if no files were selected.
Posted: 27 Sep 2005 00:17
by admin
Hm hm hm... this gets ever more strange. Winzip sends Effect=1 to OLEDragOver, but WinRAR sends Effect=3 and this is bad for a lot of complicated reasons... to put it short: you can't have dropping from WinRAR
and autodetection of the default file operation (watch the drag cursor change between copy and move when you drag over different targets...) at the same time.
Gotta sleep...
Posted: 27 Sep 2005 02:02
by jacky
admin wrote:Hm hm hm... this gets ever more strange. Winzip sends Effect=1 to OLEDragOver, but WinRAR sends Effect=3 and this is bad for a lot of complicated reasons... to put it short: you can't have dropping from WinRAR
and autodetection of the default file operation (watch the drag cursor change between copy and move when you drag over different targets...) at the same time.
There a bit I don't understand, there is no autodetection (copy or move) when dragging from any soft, WinRAR or WinZIP, and it should be that way. I mean default action when coming out of a compressed file should always be copy, doesn't matter if we'll extract on the same drive as the compressed file is... or did I get that part wrong?

(or did you mean it's either allowing d&d from WinRAR or autodetection for "regular" d&ds ?? -- if so, explorer does it, so there must be a way....

)
Also, I think that could be it. Effect=1 means copy right? So I guess WinZIP does that cause it is always a copy. WinRAR probably uses 3 because it can handle "moving" too.
I mean even with WinZIP & explorer you can
not "move" a file using drag&drop. Even if you hold Shift it will still just be a simple extraction (copy).
But, with WinRAR, if you hold Shift then WinRAR will remove the file(s) from the archive when done!! (aka you "moved" them out) ! That might be why they don't act the same....
(and WinRAR is the best!!
)
Posted: 27 Sep 2005 10:04
by admin
jacky wrote:...or did you mean it's either allowing d&d from WinRAR or autodetection for "regular" d&ds ?? -- if so, explorer does it, so there must be a way....

)
Yes, that's what I meant. And yes, there is a way and I found it

Explorer sets Effect=7, and that's what TV3 now does, too, when starting a drag (AllowedEffects = 7). Now I can autodetect TV3-internal drags, and leave all others untouched. Works great now.
jacky wrote:... But, with WinRAR, if you hold Shift then WinRAR will remove the file(s) from the archive when done!! (aka you "moved" them out) ! That might be why they don't act the same....
(and WinRAR is the best!!
)
Cool indeed! And works with TV3 now, too

Posted: 27 Sep 2005 14:53
by JustinF
Cool! Both WinZip and WinRar work. Unfortunately AlZip still gives the same error.

I'm not completely tied to AlZip, but I like the idea of an (un)compression program that doesn't nag you...anyone know of another one?
Thanks for your hard work on this one, Donald. Next time you're in Omaha lunch is on me.

Posted: 27 Sep 2005 15:20
by jacky
admin wrote:jacky wrote:... But, with WinRAR, if you hold Shift then WinRAR will remove the file(s) from the archive when done!! (aka you "moved" them out) ! That might be why they don't act the same....
(and WinRAR is the best!!
)
Cool indeed! And works with TV3 now, too

Well done, it's all great!
Just one little thing, when doing a drag&drop from WinRAR and holding Shift, could you change the cursor so the little plus sign (for copy) goes away? Could be confusing I think since the file will be removed from the archive....
Posted: 27 Sep 2005 19:42
by admin
jacky wrote:Just one little thing, when doing a drag&drop from WinRAR and holding Shift, could you change the cursor so the little plus sign (for copy) goes away? Could be confusing I think since the file will be removed from the archive....
I'd love to, but it's not possible! (Try it with your test project) I never managed to change the mouse cursor when dragging onto TrackerV3 from another app (even from another TV3 instance). The source window apparently owns the cursor...?
Posted: 27 Sep 2005 21:32
by jacky
admin wrote:jacky wrote:Just one little thing, when doing a drag&drop from WinRAR and holding Shift, could you change the cursor so the little plus sign (for copy) goes away? Could be confusing I think since the file will be removed from the archive....
I'd love to, but it's not possible! (Try it with your test project) I never managed to change the mouse cursor when dragging onto TrackerV3 from another app (even from another TV3 instance). The source window apparently owns the cursor...?
Damn that wasn't easy to find! Ok so seems that it is owned by the source, but you have to let it know what to do.
To do that, inside the
OLEDragOver event you'll need to change the value of Effect. So changing it to vbDropEffectMove will inform the source that it will be a move operation, and the cursor will be update as so.
In my little test project, it works (dragging from TV3, WinRAR, etc) if I add this:
Code: Select all
Private Sub List1_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
Select Case Shift
Case 0, 2: 'classic, or wilh Ctrl
Effect = vbDropEffectCopy
Case 1: 'Shift
Effect = vbDropEffectMove
Case Else: 'Alt, Shift+Ctrl, etc so we cancel this (unsupported)
Effect = vbDropEffectNone
End Select
End Sub
I've noticed that When dragging form TV3 for example, this will change the cursor to the "undroppable" one if you holf Alt, Ctrl+Shift or something like that, while for WinRAR it will show the usual one (Copy). But, WinRAR will still not do anything as it was told to.