Deleting to Recycle bin: Extree hangs

The place for threads about version 1.x of TimoSoft ExplorerTreeView.
Post Reply
thVb6
Cadet
Posts: 7
Joined: 03 Sep 2009, 17:50

Deleting to Recycle bin: Extree hangs

Post by thVb6 »

Hi,
Im using Extre 1.15.870 on W2K.
When I delete a file from extre into recycle bin by Api SHFileOperation (from http://www.aboutvb.de/khw/artikel/khwshellkill.htm), extre hangs with the second file.
It seems, that it takes lots of time, until the message of the deleted file reaches extre.
If the next del-advice meets to early the whole IDE crashes.
I call the above mentioned sub with passing the hwnd from the extre, tried also the form.hwnd, but nothing changes. filename is passed by ext.ItemHandleToFSPath(ext.SelectedItem)
Is there a chance, to delete files from extre to recycle bin without geting VB crashed? Mayby to tell extre quicker, that that file is moved to recycle bin?

Thanks in advance.
TH
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: Deleting to Recycle bin: Extree hangs

Post by TiKu »

Hi,

sorry for my late answer. I'm very busy.
Auto-update always has been very tricky if the recycle bin is involved, because accessing the recycle bin (e.g. to update the data displayed by ExplorerTreeView after receiving an auto-update message) triggers a new auto-update message most of the times. I've implemented some heuristics to detect such situations and ignore the accidental auto-update events. However, this does not work very well.
ExplorerTreeView 1.x doesn't process auto-update events in a background thread because it is written in VB6 and VB6 doesn't support multi-threading. This explains why the control becomes very slow if it is flooded with auto-update events.
I doubt that I can fix this problem. However, I can provide a way to temporarily disable auto-update. Please let me know if you are interested in this workaround.

Regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
thVb6
Cadet
Posts: 7
Joined: 03 Sep 2009, 17:50

Re: Deleting to Recycle bin: Extree hangs

Post by thVb6 »

TiKu wrote:sorry for my late answer. I'm very busy.
Thanks for your answer anyway!
TiKu wrote:However, I can provide a way to temporarily disable auto-update. Please let me know if you are interested in this workaround.
This would actualy be a great help to me. If you could work out this workaround it would be fine!
How can I achieve this workaround? Will you set an update for download?
Thanks!
TH
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: Deleting to Recycle bin: Extree hangs

Post by TiKu »

I don't need to implement anything for the work-around. It's a hidden feature. It's hidden, because when I wrote ExplorerTreeView 1.x, I did not design it to work with ghost items and therefore there are chances that disabling auto-update will lead to strange problems. However, a friend of mine has been using this feature for many years now and it seems to work very well. Also the control has become much more robust over the years.

To enable/disable auto-update a special message has to be sent to the control window:

Code: Select all

  Private Const WM_USER = &H400
  Private Const EXTVM_SETAUTOUPDATE = (WM_USER + 20)

  Private Declare Function SendMessageAsLong Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Private Sub DisableAutoUpdate()
  Debug.Print SendMessageAsLong(ExTvw.hWnd, EXTVM_SETAUTOUPDATE, 0, 0)
End Sub

Private Sub EnableAutoUpdate()
  Debug.Print SendMessageAsLong(ExTvw.hWnd, EXTVM_SETAUTOUPDATE, 1, 0)
End Sub
That's it. The return value of this message is the previous setting (1 for enabled, 0 for disabled).

Best regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
thVb6
Cadet
Posts: 7
Joined: 03 Sep 2009, 17:50

Re: Deleting to Recycle bin: Extree hangs

Post by thVb6 »

TiKu wrote: That's it.
You are right. Works fine! Wonderful!
Thanks to Unterföhring...
Post Reply