-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Ok I found I solution for the default share/link ones. I don't know if this is how I was doing it during tests the other week but it's working now. Replace the InitImageLists function with this one:
Code:
Private Sub InitImageLists()
If IsComCtl6 = False Then
himlTV = ImageList_Create(mIconSize, mIconSize, ILC_COLOR32 Or ILC_MASK, 1, 1)
Dim clbk As Long
OleTranslateColor clrBack, 0&, clbk
ImageList_SetBkColor himlTV, clbk
Else
himlTV = ImageList_Create(mIconSize, mIconSize, ILC_COLOR32 Or ILC_MASK Or ILC_HIGHQUALITYSCALE, 1, 1)
End If
Call SHGetImageList(SHIL_JUMBO, IID_IImageList, imlSysJM)
hSysIL = ObjPtr(imlSysJM)
End Sub
Also make the first line of EnsureOverlay
If nIdx = -1 Then Exit Function
Shouldn't be letting it raise an error.
Haven't looked into the extended ones crashing yet. I stopped using them myself because, at least on my last Windows install, retrieving them was *painfully* slow. Like 10x the execution time slow.
-
2 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
Ok I found I solution for the default share/link ones. I don't know if this is how I was doing it during tests the other week but it's working now. Replace the InitImageLists function with this one:
The overlay icons are displayed again with the code changes BUT they are very tiny now:
Attachment 190292
Windows Explorer:
Attachment 190293
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Yeah that's a combination of DPI and custom resolution support issues; if you're dpi aware, turn it off so the system does it; that generally works better. Choosing a different icon size will help too.
Like in my DPI-unaware test app, they look like this, with the default icon size of 24:
Attachment 190295
-
2 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
Yeah that's a combination of DPI and custom resolution support issues; if you're dpi aware, turn it off so the system does it; that generally works better. Choosing a different icon size will help too.
My apps are not DPI-aware too.
I tested v2.7 and 2.9.2 with Win10 using a System-DPI scale of 150% and a ShellTree icon size of 16px:
Attachment 190296
The overlay icon with v2.7 looks correct and clearly visible. The arrow stays in a checkbox with a white background.
The overlay icon since 2.9 looks like a part of the old overlay icon and zoomed in:
Attachment 190297
Can you check this in your code? There must be something wrong.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Maybe try ILD_SCALE and/or ILD_DPISCALE as additional flags in EnsureOverlay->imlSysJM.GetIcon nOvr, ILD_TRANSPARENT, hIcon
If that doesn't help, the only remedy would be a lot of fragile manual sizing that would likely then wind up looking wrong on other people's systems.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
Maybe try ILD_SCALE and/or ILD_DPISCALE as additional flags in EnsureOverlay->imlSysJM.GetIcon nOvr, ILD_TRANSPARENT, hIcon
If that doesn't help, the only remedy would be a lot of fragile manual sizing that would likely then wind up looking wrong on other people's systems.
I fixed the overlay icon size problem in your code:
At Sub "InitImageLists" change:
Code:
Call SHGetImageList(SHIL_JUMBO, IID_IImageList, imlSysJM)
back to:
Code:
Call SHGetImageList(SHIL_SMALL, IID_IImageList, imlSysJM)
But this will break icon size property. A icons size >16 is not possible anymore.
I guess you have to use a separate ImageList for the overlay icons because they only use 16x16.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Well yeah if you shrink the icons the overlay will appear larger relative to them. The real question is why the overlay isn't scaling like the icons.
So IconSize still works with your suggestion for me using a separate ImageList; but I never had the issue with them being too small. See if it works with the following changes, if so, it will be put into the release:
To module level declares, add: Private imlSysSM As IImageList
To InitImageLists, add: Call SHGetImageList(SHIL_SMALL, IID_IImageList, imlSysSM) (and revert JM back to JUMBO)
Change EnsureOverlay to:
Code:
Private Function EnsureOverlay(nIdx As Long) As Long
If nIdx = -1 Then Exit Sub
If bOvrAdded(nIdx) Then EnsureOverlay = 1: Exit Function
Dim nOvr As Long
Dim hIcon As LongPtr
Dim nPos As Long
imlSysSM.GetOverlayImage nIdx, nOvr
If nOvr >= 0 Then
imlSysSM.GetIcon nOvr, ILD_TRANSPARENT, hIcon
nPos = ImageList_AddIcon(himlTV, hIcon)
Call DestroyIcon(hIcon)
ImageList_SetOverlayImage himlTV, nPos, nIdx
bOvrAdded(nIdx) = True
End If
End Function
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
FIXED: I added the changes and now the overlay icons are looking normal using IconSize=16!
I just want to let you know about another issue with the IconSize property:
You should remove "Public Property Let IconSize(cxy As Long)" because you mess up the tree if you, for example, set the ShellTree control to a standard IconSize value of 32px and in the form_load event you set ucTree.IconSize=16...or visa versa
-
Feature request: Show only file checkboxes
For a multiple file selection dialog i want to hide the checkboxes for non-files like you do with mRootHasCheckbox for the root only.
I think about a property like ShowOnlyFileCheckboxes.
For example:
Code:
if bFolder = true and checkboxes = true and showfiles = true and ShowOnlyFileCheckboxes = true then
TreeView_SetCheckStateEx hTVD, hitem, 0 ' no checkbox for non-filees
endif
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I added the property ShowOnlyFileCheckbox and at TVExpandFolder i changed
Code:
If bFav Then
TreeView_SetCheckStateEx hTVD, hitemPrev, 0
Else
to
Code:
If bFav Or (bFolder = True And mShowOnlyFileCheckbox = True) Then
TreeView_SetCheckStateEx hTVD, hitemPrev, 0
Else
and it works for expand items but not for the root enum:
Attachment 190306
Where can i change the checkbox state for the root enum items?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
RootHasCheckbox property already exists; is it not working?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
RootHasCheckbox property already exists; is it not working?
No, it's set to false but still show the checkboxes.
Reason:
I have to set the control property ShowCheckboxes=True.
If the control property ShowCheckboxes is set to False and i set .ShowCheckboxes =True in the code it doesnt work....
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
How can i init all the control properties in the form_load or form_activate event before the treeview is created?
I set them in the code and after i used RefreshTreeView, ResetTreeView and HardResetTreeView but nothing works.
btw, with HardResetTreeView i get an empty control window.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
You can't... would have to do it in the designer.
I'm confused about your picture; how are there so many root nodes? If Desktop is the root, This PC shouldn't show on the same level; if This PC is the root, the Network and a couple other things shouldn't show. I can't reproduce the issue with my normal root setup with either ComputerAsRoot = True or False.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I fixed the RootHasCheckbox problem in ucWndProc -> TVN_ITEMCHANGINGW
Before:
Code:
Case TVN_ITEMCHANGINGW
If (bFilling = False) And (g_fDeleting = False) And (mAutocheck = True) Then
.....
End If
After:
Code:
Case TVN_ITEMCHANGINGW
If (bFilling = False) And (g_fDeleting = False) And (mAutocheck = True) Then
.....
ElseIf (bFilling = False) And (g_fDeleting = False) Then
'MITH
Call CopyMemory(nmtvic, ByVal lParam, LenB(nmtvic))
tvix.Mask = TVIF_STATEEX
tvix.hItem = nmtvic.hItem
Call SendMessage(hTVDW, TVM_GETITEM, 0, tvix)
If (nmtvic.hItem = m_hRoot) And (mRootHasCheckbox = False) Then
lReturn = 1
bHandled = True
Exit Sub
End If
idx = GetTVItemlParam(hTVD, nmtvic.hItem)
tNew = TVEntries(idx)
If (tNew.bFolder = True And mShowOnlyFileCheckbox = True And mShowFiles = True) Then
lReturn = 1
bHandled = True
Exit Sub
End If
End If
New code for property ShowOnlyFileCheckbox:
Code:
Private mShowOnlyFileCheckbox As Boolean
Private Const mShowOnlyFileCheckbox_def As Boolean = False
Public Property Get ShowOnlyFileCheckbox() As Boolean: ShowOnlyFileCheckbox = mShowOnlyFileCheckbox: End Property
Public Property Let ShowOnlyFileCheckbox(bVal As Boolean)
mShowOnlyFileCheckbox = bVal
End Property
Private Sub UserControl_ReadProperties(propBag As PropertyBag)
mShowOnlyFileCheckbox = propBag.ReadProperty("ShowOnlyFileCheckbox", mShowOnlyFileCheckbox_def)
End Sub
Private Sub UserControl_WriteProperties(propBag As PropertyBag)
propBag.WriteProperty "ShowOnlyFileCheckbox", mShowOnlyFileCheckbox, mShowOnlyFileCheckbox_def
End Sub
Private Sub UserControl_InitProperties()
mShowOnlyFileCheckbox = mShowOnlyFileCheckbox_def
End Sub
Code:
Private Sub TVExpandFolder(lParam As Long, hitemParent As Long)
.....
If bFav Or (bFolder = True And mShowOnlyFileCheckbox = True And mShowFiles = True) Then 'Mith
TreeView_SetCheckStateEx hTVD, hitemPrev, 0
Else
If TreeView_GetCheckState(hTVD, hitemParent) = 2 Then
If mAutocheck = True Then
TreeView_SetCheckState hTVD, hitemPrev, 1
End If
End If
End If
.....
End Sub
-
3 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Finally everything works & look fine for me!
Let me know if you want the "forked" ShellTTree CTL.
Sreenshots are taken in a WMware using Win10x64 Home german.
multi file selection only file checkboxes visible:
Attachment 190307
multi folder selection:
Attachment 190308
custom root multi file selection:
Attachment 190309
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Im testing the control now with Windows 11 and i found somes issues:
Using FileExtensions = Always_Show still not display many file extensions: .exe, .zip, .chm, .url, .msg, .txt, ...
At Win10 they are visible except ".url".
Code:
mNeverExpandZip = True
FileExtensions = Always_Show
CheckBoxes=True
Code:
TVAddItem:
siChild.GetDisplayName SIGDN_NORMALDISPLAY, lpName
sName = LPWSTRtoStr(lpName)
If m_ForceExt = STEP_AlwaysShow Then
siChild.GetDisplayName SIGDN_NORMALDISPLAY, lpNameFull
sNameFull = LPWSTRtoStr(lpNameFull)
Above you use the same flag when u force the the full file name. Is this correct?
2. The Desktop item in the sub-tree doesnt show all files/folders on the desktop (Win10+11):
Screenshot Win10
Attachment 190310
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
Mith
Im testing the control now with Windows 11 and i found somes issues:
Using FileExtensions = Always_Show still not display many file extensions: .exe, .zip, .chm, .url, .msg, .txt, ...
At Win10 they are visible except ".url".
Bug fixed. All file extensions are now displayed!
Changes must be made at TVAddItem & TVExpandFolder:
Before:
Code:
If m_ForceExt = STEP_AlwaysShow Then
siChild.GetDisplayName SIGDN_NORMALDISPLAY, lpNameFull
After
Code:
If m_ForceExt = STEP_AlwaysShow And bFolder = False Then
siChild.GetDisplayName SIGDN_PARENTRELATIVEPARSING, lpNameFull
and the follwing code must be executed before the above code changes because of the possible change of the variable bFolder:
Code:
If (mShowFiles = True) And (mExpandZip = False) Then
If (bFolder = True) And (bZip = True) Then
bFolder = False
End If
End If
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Very cool to see two super devs working in concert. Bravo! Now I want to create an app to use this control :D
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
1) Definite typo with the always show, thanks. .url still might not show because it's a "never show" extension like .lnk. If it is showing; is .lnk showing? Can't have .lnk showing.
2) I'm still not understanding how you're seeing so many root nodes on the same level; I'll test the change you suggested to make sure it doesn't break anything on my end but I'd really prefer to understand the issue there; there should only be 1 or 2 root nodes.
3) I can't reproduce the issue with items not showing. Can you turn on the debug log and post what it outputs on startup?
4) I've been keeping up with your changes on my end, it's very much appreciated :) I'll have a big thanks for you in the next release.
-
3 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
1) Definite typo with the always show, thanks. .url still might not show because it's a "never show" extension like .lnk. If it is showing; is .lnk showing? Can't have .lnk showing.
Now it shows ALL file extensions. For me it is ok, because i only use the control for single/multi file/folder selection but i guess we need another variable to not show the extension for LNK-files.
Attachment 190327
Quote:
Originally Posted by
fafalone
2) I'm still not understanding how you're seeing so many root nodes on the same level; I'll test the change you suggested to make sure it doesn't break anything on my end but I'd really prefer to understand the issue there; there should only be 1 or 2 root nodes.
I tested the control with a german Win10 Home on VMware.
Quote:
Originally Posted by
fafalone
3) I can't reproduce the issue with items not showing. Can you turn on the debug log and post what it outputs on startup?
It's already fixed. I used a older version while testing :-|
Quote:
Originally Posted by
fafalone
4) I've been keeping up with your changes on my end, it's very much appreciated :) I'll have a big thanks for you in the next release.
I've already added more features:
Code:
' - Added property ShowOnlyDrives. Shows only drives when ComputerAsRoot=True and
' deactivates expanding of drives
Attachment 190328
Code:
' - Added property HideRecycleBin. hides the recycle bin
' - Added property HideControlPanel. hides the Control Panel
' - Added property HideOneDrive. hides OneDrive
' - Added property HideNetwork. hides Network
' - Added property HideLibraries. hides Libraries
Attachment 190330
-
MonitorDirChanges Bug
Bug report for MonitorDirChanges=True:
The control is updated when i delete a file/folder on the desktop BUT not if i add a new file/folder on the desktop.
Tested with v2.7/2.9.x
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I added the project variable mHideLNKfileExtension to hide/unhide the LNK extension.
Code:
Private Const mHideLNKfileExtension As Boolean = True
Code change in HandleShellNotify, TVAddItem & TVExpandFolder:
Code:
If m_ForceExt = STEP_AlwaysShow And bFolder = False Then
siChild.GetDisplayName SIGDN_PARENTRELATIVEPARSING, lpNameFull 'mith - fix for correct display name
sNameFull = LPWSTRtoStr(lpNameFull)
If Right(LCase(sNameFull), 4) = ".lnk" And mHideLNKfileExtension = False Then
If Left$(sNameFull, 3) <> "::{" Then
If Left$(sNameFull, 5) <> "uuid:" Then
If Left$(sNameFull, 7) <> "usb#vid" Then
If Left$(sNameFull, 9) <> "Provider\" Then 'mith - fix for win7 Network
If InStr(sNameFull, "\?\usb#") = 0 Then
sName = sNameFull
End If
End If
End If
End If
End If
End If
End If
Above you also see another fix for the Win7 Network folder.
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
mHideLNKfileExtension=True
Looks good with Windows 11:
Attachment 190335
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Code changes for the property ShowOnlyDrives:
Attachment 190336
Code:
Private mShowOnlyDrives As Boolean
Private Const mShowOnlyDrives_def As Boolean = False
'UserControl_ReadProperties
mShowOnlyDrives = propBag.ReadProperty("ShowOnlyDrives", mShowOnlyDrives_def)
'UserControl_WriteProperties
propBag.WriteProperty "ShowOnlyDrives", mShowOnlyDrives, mShowOnlyDrives_def
'UserControl_InitProperties
mShowOnlyDrives = mShowOnlyDrives_def
Public Property Get ShowOnlyDrives() As Boolean: ShowOnlyDrives = mShowOnlyDrives: End Property
Public Property Let ShowOnlyDrives(bVal As Boolean)
mShowOnlyDrives = bVal
End Property
TVExpandFolder before:
Code:
siChild.GetDisplayName SIGDN_PARENTRELATIVEPARSING, lpNameFull
sNameFull = LPWSTRtoStr(lpNameFull)
If (m_HiddenPref = STHP_UseExplorer) Then
change to:
Code:
siChild.GetDisplayName SIGDN_PARENTRELATIVEPARSING, lpNameFull
sNameFull = LPWSTRtoStr(lpNameFull)
If mComputerAsRoot = True And mShowOnlyDrives = True Then
If Left(sNameFull, 3) = "::{" Then GoTo nxt
End If
If (m_HiddenPref = STHP_UseExplorer) Then
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Code changes for the new properties:
HideRecycleBin
HideControlPanel
HideOneDrive
HideNetwork
HideLibraries
Attachment 190337
Code:
Private mHideRecycleBin As Boolean
Private Const mHideRecycleBin_def As Boolean = False
Private mHideControlPanel As Boolean
Private Const mHideControlPanel_def As Boolean = False
Private mHideOneDrive As Boolean
Private Const mHideOneDrive_def As Boolean = False
Private mHideNetwork As Boolean
Private Const mHideNetwork_def As Boolean = False
Private mHideLibraries As Boolean
Private Const mHideLibraries_def As Boolean = False
'UserControl_ReadProperties
mHideRecycleBin = propBag.ReadProperty("HideRecycleBin", mHideRecycleBin_def)
mHideControlPanel = propBag.ReadProperty("HideControlPanel", mHideControlPanel_def)
mHideOneDrive = propBag.ReadProperty("HideOneDrive", mHideOneDrive_def)
mHideNetwork = propBag.ReadProperty("HideNetwork", mHideNetwork_def)
mHideLibraries = propBag.ReadProperty("HideLibraries", mHideLibraries_def)
'UserControl_WriteProperties
propBag.WriteProperty "HideRecycleBin", mHideRecycleBin, mHideRecycleBin_def
propBag.WriteProperty "HideControlPanel", mHideControlPanel, mHideControlPanel_def
propBag.WriteProperty "HideOneDrive", mHideOneDrive, mHideOneDrive_def
propBag.WriteProperty "HideNetwork", mHideNetwork, mHideNetwork_def
propBag.WriteProperty "HideLibraries", mHideLibraries, mHideLibraries_def
'UserControl_InitProperties
mHideRecycleBin = mHideRecycleBin_def
mHideControlPanel = mHideControlPanel_def
mHideOneDrive = mHideOneDrive_def
mHideNetwork = mHideNetwork_def
mHideLibraries = mHideLibraries_def
Public Property Get HideRecycleBin() As Boolean: HideRecycleBin = mHideRecycleBin: End Property
Public Property Let HideRecycleBin(bVal As Boolean)
mHideRecycleBin = bVal
End Property
Public Property Get HideControlPanel() As Boolean: HideControlPanel = mHideControlPanel: End Property
Public Property Let HideControlPanel(bVal As Boolean)
mHideControlPanel = bVal
End Property
Public Property Get HideOneDrive() As Boolean: HideOneDrive = mHideOneDrive: End Property
Public Property Let HideOneDrive(bVal As Boolean)
mHideOneDrive = bVal
End Property
Public Property Get HideNetwork() As Boolean: HideNetwork = mHideNetwork: End Property
Public Property Let HideNetwork(bVal As Boolean)
mHideNetwork = bVal
End Property
Public Property Get HideLibraries() As Boolean: HideLibraries = mHideLibraries: End Property
Public Property Let HideLibraries(bVal As Boolean)
mHideLibraries = bVal
End Property
TVExpandFolder before:
Code:
siChild.GetDisplayName SIGDN_PARENTRELATIVEPARSING, lpNameFull
sNameFull = LPWSTRtoStr(lpNameFull)
If (m_HiddenPref = STHP_UseExplorer) Then
After:
Code:
siChild.GetDisplayName SIGDN_PARENTRELATIVEPARSING, lpNameFull
sNameFull = LPWSTRtoStr(lpNameFull)
If mHideControlPanel = True Then ' Mith
If sNameFull = "::{26EE0668-A00A-44D7-9371-BEB064C98683}" Then GoTo nxt
If sNameFull = "::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" Then GoTo nxt
End If
If mHideRecycleBin = True Then ' Mith
If sNameFull = "::{645FF040-5081-101B-9F08-00AA002F954E}" Then GoTo nxt
End If
If mHideOneDrive = True Then ' Mith
If sNameFull = "::{018D5C66-4533-4307-9B53-224DE2ED1FE6}" Then GoTo nxt
End If
If mHideNetwork = True Then ' Mith
If sNameFull = "::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" Then GoTo nxt
End If
If mHideLibraries = True Then ' Mith
If sNameFull = "::{031E4825-7B94-4DC3-B131-E946B44C8DD5}" Then GoTo nxt
End If
If (m_HiddenPref = STHP_UseExplorer) Then
-
New feature added
I fixed another issue:
Currently you can't set up the control properties before the ShellTree is created.
Solution:
I added the project variable mCreateShellTreeManually and the public function "Create_ShellTree":
Code:
' - Added project variable mCreateShellTreeManually.
' True = you have to call the new public function "Create_ShellTree" to create the ShellTree.
' This enables you to set up all control properties in the code before the ShellTree
' is created. Also avoids the enum of the ShellTree with the standard properties!
' False = ShellTree will be created automatically after reading the usercontrol properties
Private Const mCreateShellTreeManually As Boolean = False
Public Sub Create_ShellTree()
If mCreateShellTreeManually = True Then
pvCreate
End If
End Sub
Necessary code changes:
Code:
Private Sub UserControl_ReadProperties(propBag As PropertyBag)
If mCreateShellTreeManually = False Then pvCreate
End Sub
Private Sub UserControl_InitProperties()
if mCreateShellTreeManually = False Then pvCreate
End Sub
Advantages:
- you can set up the control properties before the ShellTree is created
- the initial enumeration of the ShellTree content runs only once!
- some control properties couldnt be changed after the Shelltree was created, e.g. checkboxes
Example:
Code:
'ShellTree CTL code:
mCreateShellTreeManually = True
' your form:
Private Sub Form_Load()
ucTree.Autocheck = False
ucTree.BorderStyle = STBS_None
ucTree.DisableDragDrop = True
ucTree.EnableShellMenu = False
ucTree.ExclusionChecks = False
ucTree.ExpandZip = False
ucTree.InfoTipOnFiles = False
ucTree.LabelEditRename = False
ucTree.PlayNavigationSound = False
ucTree.ShowFavorites = False
ucTree.ShowHiddenItems = STHP_AlwaysShow
ucTree.ShowSuperHidden = STSHP_AlwaysShow
ucTree.SingleClickExpand = True
ucTree.AutoExpandLibraries = False
ucTree.AutoExpandComputer = False
ucTree.DisableWow64Redirect = False
ucTree.FileExtensions = STEP_AlwaysShow
ucTree.ShowQuickAccessOnWin10 = False
ucTree.ShowOnlyFileCheckbox = True
ucTree.ComputerAsRoot = False
Call ucTree.Create_ShellTree
End Sub
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
Mith
I fixed the RootHasCheckbox problem in ucWndProc -> TVN_ITEMCHANGINGW
Before:
Code:
Case TVN_ITEMCHANGINGW
If (bFilling = False) And (g_fDeleting = False) And (mAutocheck = True) Then
.....
End If
After:
Code:
Case TVN_ITEMCHANGINGW
If (bFilling = False) And (g_fDeleting = False) And (mAutocheck = True) Then
.....
ElseIf (bFilling = False) And (g_fDeleting = False) Then
'MITH
Call CopyMemory(nmtvic, ByVal lParam, LenB(nmtvic))
tvix.Mask = TVIF_STATEEX
tvix.hItem = nmtvic.hItem
Call SendMessage(hTVDW, TVM_GETITEM, 0, tvix)
If (nmtvic.hItem = m_hRoot) And (mRootHasCheckbox = False) Then
lReturn = 1
bHandled = True
Exit Sub
End If
idx = GetTVItemlParam(hTVD, nmtvic.hItem)
tNew = TVEntries(idx)
If (tNew.bFolder = True And mShowOnlyFileCheckbox = True And mShowFiles = True) Then
lReturn = 1
bHandled = True
Exit Sub
End If
End If
I found a bug in my code changes. I copied and paste to much of your code :)
The correct changes are:
Code:
Case TVN_ITEMCHANGINGW
If (bFilling = False) And (g_fDeleting = False) And (mAutocheck = True) Then
.....
ElseIf (bFilling = False) And (g_fDeleting = False) Then
'MITH
Call CopyMemory(nmtvic, ByVal lParam, LenB(nmtvic))
idx = GetTVItemlParam(hTVD, nmtvic.hItem)
tNew = TVEntries(idx)
If (tNew.bFolder = True And mShowOnlyFileCheckbox = True And mShowFiles = True) Then
lReturn = 1
bHandled = True
Exit Sub
End If
End If
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
I fixed another issue:
Currently you can't set up the control properties before the ShellTree is created.
Solution:
I added the project variable mCreateShellTreeManually and the public function "Create_ShellTree":
I'm curious, why this over the designer?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
I'm curious, why this over the designer?
1. You can set up the control properties before the ShellTree is created for different display scenarios.
2. It's fast because when i set .CustomRoot ="C:\test" for example the control doesnt start the enumeration for the Desktop first.
3. Some control properties couldnt be changed after the Shelltree was created, e.g. checkboxes.
MSDN (https://learn.microsoft.com/en-us/wi...ended-styles):
Quote:
The tree-view control has a very specific behavior for the checkbox styles. When a specific style or 'EX'-style combination is activated, the control keeps it to the end of its life (which means that you cannot modify the first checkbox style during the life of tree-view control).
4. Sometimes you have to remove and redrop the control on the form and all your property settings are lost
...
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
1/4 make sense... I'll include that in release too (and probably add that ability to ucShellBrowse too).
(2/3 are the same with the designer; it won't load desktop if custom root is set and you can set Checkboxes)
Though I might look into why you can only call pvCreate once. This need is seemingly brought on by this not working:
DestroyWindow hTVD
pvCreate
If that worked you could change settings during runtime too.
PS- I definitely appreciate all the love you're giving this project; I've got so many other interesting projects I've neglected substantially upgrading this one for a while.
-
Bugfix
Quote:
Originally Posted by
Mith
I added the project variable mHideLNKfileExtension to hide/unhide the LNK extension.
Code:
Private Const mHideLNKfileExtension As Boolean = True
Code change in HandleShellNotify, TVAddItem & TVExpandFolder:
Code:
If m_ForceExt = STEP_AlwaysShow And bFolder = False Then
siChild.GetDisplayName SIGDN_PARENTRELATIVEPARSING, lpNameFull 'mith - fix for correct display name
sNameFull = LPWSTRtoStr(lpNameFull)
If Right(LCase(sNameFull), 4) = ".lnk" And mHideLNKfileExtension = False Then
If Left$(sNameFull, 3) <> "::{" Then
If Left$(sNameFull, 5) <> "uuid:" Then
If Left$(sNameFull, 7) <> "usb#vid" Then
If Left$(sNameFull, 9) <> "Provider\" Then 'mith - fix for win7 Network
If InStr(sNameFull, "\?\usb#") = 0 Then
sName = sNameFull
End If
End If
End If
End If
End If
End If
End If
Above you also see another fix for the Win7 Network folder.
Bugfix for the code above:
Code:
If Right(LCase(sNameFull), 4) = ".lnk" Then
If mHideLNKfileExtension = False Then
sName = sNameFull
End If
ElseIf Left$(sNameFull, 3) <> "::{" Then
If Left$(sNameFull, 5) <> "uuid:" Then
If Left$(sNameFull, 7) <> "usb#vid" Then
If Left$(sNameFull, 9) <> "Provider\" Then 'mith fix for win7 Network
If InStr(sNameFull, "\?\usb#") = 0 Then
sName = sNameFull
End If
End If
End If
End If
End If
-
1 Attachment(s)
DisableWow64Redir not work
Win10x64
I want to select the system file "manage-bde.exe" with the ShellTree control but i cant find it anywhere.
The location of the file manage-bde.exe is "C:\windows\system32\manage-bde.exe".
See Windows Explorer:
Attachment 190350
The file above is a hard link from "C:\Windows\WinSxS\amd64_microsoft-windows-securestartup-tool-exe_31bf3856ad364e35_10.0.19041.1_none_b00bcb3b56b3d8e3\manage-bde.exe"
The open secret for 32-bit apps:
Quote:
whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64
But i can't find the file inside SysWOW64 too.
I tried your new control property DisableWow64Redir but i still cant find the file in folder "C:\windows\system32".
I also used Wow64DisableWow64FsRedirection outside in my form code before i show the control but still no luck to find this file.
Please can you try this on your computer? Any ideas whats going on here?
-
2 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Win8.1
I tried to open the path "C:\Users\adminENG\AppData\Local\Temp" but ShellControl doesnt do it because the folder "AppData" is hidden. ShowHiddenItems & ShowSuperHidden are set to "1 - STHP_AlwaysShow":
Attachment 190352
I can open the path with Windows Explorer but the folder is not visible in the left tree:
Attachment 190351
Any ideas why ShellControl doesnt show hidden folders inside the User-folder?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Just tested this and it works:
Code:
Debug.Print FileExists("C:\Windows\System32\manage-bde.exe")
' Output: False
Code:
Private Declare Function Wow64DisableWow64FsRedirection Lib "kernel32" (OldValue As Long) As Long
Private Declare Function Wow64RevertWow64FsRedirection Lib "kernel32" (ByVal OldValue As Long) As Long
Dim OldValue As Long
If Wow64DisableWow64FsRedirection(OldValue) Then
Debug.Print FileExists("C:\Windows\System32\manage-bde.exe")
Wow64RevertWow64FsRedirection OldValue
End If
' Output: True
You can replace the "FileExists" function above with any other file access function you want.
Code:
Public Function FileExists(sPath As String, Optional bFolderExists As Boolean, Optional bDeleteFileOrFolder As Boolean) As Boolean
Dim lAttributes As Long
lAttributes = GetFileAttributesW(StrPtr(sPath))
If lAttributes <> INVALID_HANDLE_VALUE Then
If bFolderExists Then
FileExists = (lAttributes And FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY
If FileExists Then If bDeleteFileOrFolder Then bDeleteFileOrFolder = RemoveDirectoryW(StrPtr(sPath))
Else
FileExists = (lAttributes And FILE_ATTRIBUTE_DIRECTORY) <> FILE_ATTRIBUTE_DIRECTORY
If FileExists Then If bDeleteFileOrFolder Then bDeleteFileOrFolder = DeleteFileW(StrPtr(sPath))
End If
End If
End Function
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
VanGoghGaming
Just tested this and it works: ...
The ShellControl doesnt uses file APIs to enumerate files and folder...it uses Shell-APIs to enumerate, e.g.:
Code:
Dim pKFM As oleexp.KnownFolderManager
Dim pkf As oleexp.IKnownFolder
Dim siFav As oleexp.IShellItem
I guess Wow64DisableWow64FsRedirection has no effect using Shell-APIs.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I was just trying to point out that "Wow64DisableWow64FsRedirection" is successful in disabling the redirection. It shouldn't matter how you access the files.
The documentation does say to pair "Wow64DisableWow64FsRedirection" with "Wow64RevertWow64FsRedirection" when you're done.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
ucShellTree already has a .DisableWow64Redirect option. I checked, it works as expected, my enumeration of System32 shows the SysWOW64 contents when the option is disabled, but the real System32 contents when enabled.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
ucShellTree already has a .DisableWow64Redirect option. I checked, it works as expected, my enumeration of System32 shows the SysWOW64 contents when the option is disabled, but the real System32 contents when enabled.
Do you see the file manage-bde.exe in the folder system32 or SysWOW64 in the ucShellTree?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
System32 if .DisableWow64Redirect = True, otherwise don't see it in either because it's only in System32.
Bug: Disabling of Wow64 redirection wasn't reverted on terminate.
Fix: Add If m_NoWow64 Then RevertWow64Redir() to UserControl_Terminate
This would leave redirection disable = true if you set it through multiple runs if running from the IDE after you changed it back to False.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
System32 if .DisableWow64Redirect = True, otherwise don't see it in either because it's only in System32.
Bug: Disabling of Wow64 redirection wasn't reverted on terminate.
Fix: Add If m_NoWow64 Then RevertWow64Redir() to UserControl_Terminate
This would leave redirection disable = true if you set it through multiple runs if running from the IDE after you changed it back to False.
It works now! I can see the file in the tree. Problem solved!
-
2 Attachment(s)
MonitorDirChanges issues
MonitorDirChanges=True
I have some issues with dir monitoring while testing the ucShellTree with Windows 11:
1. I renamed a file and a folder via F2 in the Windows Explorer:
ucShellControl doesnt recognize the new names and still shows the old names.
Attachment 190370
2. I deleted a file and a folder in a folder:
ucShellControl still shows the deleted file and folder in the tree.
3. I created a file in the Windows Explorer and changed the name:
The icon of the new file is blank in the tree. See screenshot below.
The icon gets visible when the file is selected by the user!
4. I created a new folder inside a non-empty folder and changed the name:
The icon of the new folder is not correct:
Attachment 190371
The icon is correct if i create a new folder inside an empty folder!
I hope you can reproduce the issues with the infos above and fix it :)
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Can you turn on the logs and look at what information it's receiving? The quality of shell change notifications has been going down for a while now. It might be the case there's not much to be done. First, they stopped sending some messages more and more in favor of Update Directory notifications. Then the even more insidious: Even simple actions spams the ever-living-f- out of you with notifications; you'll get 20 notifications of it sending 5 rename messages, a delete message, a rename (to temp name) message, then back and forth 5 times between temp names, deleting, renaming, updating, etc... all of that just on a single new file.
As you can see I already had to put in a lot of stuff to keep up with it on Windows 7; I know 10 was worse. I'd like to know how crazy the log is going on 11 before I spend a hour to set up a Win11 virtual machine again (I forgot to copy a few of my test VMs in my recent reinstall).
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
Can you turn on the logs and look at what information it's receiving?
Windows 10 logs:
1. Creating a new folder in a empty folder without changing the default folder name:
Code:
[ST][2024-02-06 19:47:23] HandleShellNotify::code=SHCNE_MKDIR,itm1=E:\MonitorDirTest\Neuer Ordner,itm2=
[ST][2024-02-06 19:47:23] HandleShellNotify::code=SHCNE_MKDIR,itm1=E:\MonitorDirTest\Neuer Ordner,itm2=
[ST][2024-02-06 19:47:23] ADD hNodePar=170153280
[ST][2024-02-06 19:47:23] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:47:24] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=::{645FF040-5081-101B-9F08-00AA002F954E},itm2=
[ST][2024-02-06 19:47:24] UD Last=697707343,now=697777718,dif=70375
[ST][2024-02-06 19:47:24] nDev=2
[ST][2024-02-06 19:47:24] Got PortableDevice(0)=\\?\swd#wpdbusenum#{b2e29d5f-ec8b-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:47:24] Got PortableDevice(1)=\\?\swd#wpdbusenum#{3e477a54-ea61-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\ucShellTree41.ctl.lnk,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\ucShellTree41.ctl.lnk,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\Neuer Ordner.lnk,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\Neuer Ordner.lnk,itm2=
[ST][2024-02-06 19:47:26] ADD hNodePar=-1
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\ucShellTree41.ctl.lnk,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\ucShellTree41.ctl.lnk,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\Neuer Ordner.lnk,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\Neuer Ordner.lnk,itm2=
[ST][2024-02-06 19:47:26] ADD hNodePar=-1
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=Neuer Ordner,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=Neuer Ordner,itm2=
[ST][2024-02-06 19:47:26] ADD hNodePar=-1
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 19:47:26] UD Last=697777718,now=697780156,dif=2438
[ST][2024-02-06 19:47:26] nDev=2
[ST][2024-02-06 19:47:26] Got PortableDevice(0)=\\?\swd#wpdbusenum#{b2e29d5f-ec8b-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:47:26] Got PortableDevice(1)=\\?\swd#wpdbusenum#{3e477a54-ea61-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:47:26] ADD hNodePar=-1
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:47:26] ADD hNodePar=-1
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:47:26] ADD hNodePar=-1
[ST][2024-02-06 19:47:26] HandleShellNotify::code=SHCNE_FREESPACE,itm1=,itm2=
[ST][2024-02-06 19:47:27] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\MonitorDirTest.lnk,itm2=
[ST][2024-02-06 19:47:27] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\MonitorDirTest.lnk,itm2=
[ST][2024-02-06 19:47:27] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\MonitorDirTest.lnk,itm2=
[ST][2024-02-06 19:47:27] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\MonitorDirTest.lnk,itm2=
[ST][2024-02-06 19:47:27] ADD hNodePar=-1
[ST][2024-02-06 19:47:27] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 19:47:27] UD Last=697780156,now=697780578,dif=422
[ST][2024-02-06 19:47:27] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 19:47:27] UD Last=697780578,now=697780593,dif=15
[ST][2024-02-06 19:47:28] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=C:\Users\mt\Desktop\B
2. Creating a new folder and changing the default folder name:
Code:
[ST][2024-02-06 19:50:03] HandleShellNotify::code=SHCNE_MKDIR,itm1=E:\MonitorDirTest\Neuer Ordner (2),itm2=
[ST][2024-02-06 19:50:03] HandleShellNotify::code=SHCNE_MKDIR,itm1=E:\MonitorDirTest\Neuer Ordner (2),itm2=
[ST][2024-02-06 19:50:03] ADD hNodePar=170153280
[ST][2024-02-06 19:50:03] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:50:03] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=::{645FF040-5081-101B-9F08-00AA002F954E},itm2=
[ST][2024-02-06 19:50:03] UD Last=697780593,now=697937125,dif=156532
[ST][2024-02-06 19:50:03] nDev=2
[ST][2024-02-06 19:50:03] Got PortableDevice(0)=\\?\swd#wpdbusenum#{b2e29d5f-ec8b-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:50:03] Got PortableDevice(1)=\\?\swd#wpdbusenum#{3e477a54-ea61-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_RENAMEFOLDER,itm1=E:\MonitorDirTest\Neuer Ordner (2),itm2=E:\MonitorDirTest\Neuer Ordner test
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_RENAMEFOLDER,itm1=E:\MonitorDirTest\Neuer Ordner (2),itm2=E:\MonitorDirTest\Neuer Ordner test
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=::{645FF040-5081-101B-9F08-00AA002F954E},itm2=
[ST][2024-02-06 19:50:08] UD Last=697937125,now=697942031,dif=4906
[ST][2024-02-06 19:50:08] nDev=2
[ST][2024-02-06 19:50:08] Got PortableDevice(0)=\\?\swd#wpdbusenum#{b2e29d5f-ec8b-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:50:08] Got PortableDevice(1)=\\?\swd#wpdbusenum#{3e477a54-ea61-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\Neuer Ordner test.lnk,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\Neuer Ordner test.lnk,itm2=
[ST][2024-02-06 19:50:08] ADD hNodePar=-1
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\Neuer Ordner test.lnk,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\Neuer Ordner test.lnk,itm2=
[ST][2024-02-06 19:50:08] ADD hNodePar=-1
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=Neuer Ordner test,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=Neuer Ordner test,itm2=
[ST][2024-02-06 19:50:08] ADD hNodePar=-1
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 19:50:08] UD Last=697942031,now=697942156,dif=125
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:50:08] ADD hNodePar=-1
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:50:08] ADD hNodePar=-1
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_CREATE,itm1=MonitorDirTest,itm2=
[ST][2024-02-06 19:50:08] ADD hNodePar=-1
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_FREESPACE,itm1=,itm2=
[ST][2024-02-06 19:50:08] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 19:50:08] UD Last=697942156,now=697942156,dif=0
[ST][2024-02-06 19:50:09] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\MonitorDirTest (2).lnk,itm2=
[ST][2024-02-06 19:50:09] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\MonitorDirTest (2).lnk,itm2=
[ST][2024-02-06 19:50:09] ADD hNodePar=-1
[ST][2024-02-06 19:50:09] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\MonitorDirTest (2).lnk,itm2=
[ST][2024-02-06 19:50:09] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent\MonitorDirTest (2).lnk,itm2=
[ST][2024-02-06 19:50:09] ADD hNodePar=-1
[ST][2024-02-06 19:50:09] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 19:50:09] UD Last=697942156,now=697942687,dif=531
[ST][2024-02-06 19:50:09] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\mt\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 19:50:09] UD Last=697942687,now=697942687,dif=0
[ST][2024-02-06 19:50:09] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=::{645FF040-5081-101B-9F08-00AA002F954E},itm2=
[ST][2024-02-06 19:50:09] UD Last=697942687,now=697942687,dif=0
3. Creating a new file without changing the default file name:
Code:
[ST][2024-02-06 19:52:14] HandleShellNotify::code=SHCNE_CREATE,itm1=E:\MonitorDirTest\Neues Textdokument.txt,itm2=
[ST][2024-02-06 19:52:14] HandleShellNotify::code=SHCNE_CREATE,itm1=E:\MonitorDirTest\Neues Textdokument.txt,itm2=
[ST][2024-02-06 19:52:14] ADD hNodePar=170153280
[ST][2024-02-06 19:52:14] TVAddItem E:\MonitorDirTest\Neues Textdokument.txt
[ST][2024-02-06 19:52:14] Add@194 E:\MonitorDirTest\Neues Textdokument.txt
[ST][2024-02-06 19:52:14] WM_SETFOCUS pvSetIPAO Return
[ST][2024-02-06 19:52:14] WM_KILLFOCUS
[ST][2024-02-06 19:52:14] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:52:15] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
4. Creating a new file and changing the default file name:
Code:
[ST][2024-02-06 19:53:55] HandleShellNotify::code=SHCNE_CREATE,itm1=E:\MonitorDirTest\Neues Textdokument (2).txt,itm2=
[ST][2024-02-06 19:53:55] HandleShellNotify::code=SHCNE_CREATE,itm1=E:\MonitorDirTest\Neues Textdokument (2).txt,itm2=
[ST][2024-02-06 19:53:55] ADD hNodePar=170153280
[ST][2024-02-06 19:53:55] TVAddItem E:\MonitorDirTest\Neues Textdokument (2).txt
[ST][2024-02-06 19:53:55] Add@195 E:\MonitorDirTest\Neues Textdokument (2).txt
[ST][2024-02-06 19:53:55] WM_SETFOCUS pvSetIPAO Return
[ST][2024-02-06 19:53:55] WM_KILLFOCUS
[ST][2024-02-06 19:53:56] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:54:00] HandleShellNotify::code=SHCNE_RENAMEITEM,itm1=E:\MonitorDirTest\Neues Textdokument (2).txt,itm2=E:\MonitorDirTest\Neues Textdokument test.txt
[ST][2024-02-06 19:54:00] HandleShellNotify::code=SHCNE_RENAMEITEM,itm1=E:\MonitorDirTest\Neues Textdokument (2).txt,itm2=E:\MonitorDirTest\Neues Textdokument test.txt
[ST][2024-02-06 19:54:00] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:54:00] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
5. Delete a file:
Code:
[ST][2024-02-06 19:54:46] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=::{645FF040-5081-101B-9F08-00AA002F954E},itm2=
[ST][2024-02-06 19:54:46] UD Last=697942687,now=698219484,dif=276797
[ST][2024-02-06 19:54:46] nDev=2
[ST][2024-02-06 19:54:46] Got PortableDevice(0)=\\?\swd#wpdbusenum#{b2e29d5f-ec8b-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:54:46] Got PortableDevice(1)=\\?\swd#wpdbusenum#{3e477a54-ea61-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:54:46] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:54:46] HandleShellNotify::code=SHCNE_DELETE,itm1=E:\MonitorDirTest\Neues Textdokument test.txt,itm2=
[ST][2024-02-06 19:54:46] HandleShellNotify::code=SHCNE_DELETE,itm1=E:\MonitorDirTest\Neues Textdokument test.txt,itm2=
[ST][2024-02-06 19:54:46] HandleShellNotify::code=SHCNE_CREATE,itm1=E:\$RECYCLE.BIN\S-1-5-21-2415196247-1439118325-879051374-1001\$RGX2QHD.txt,itm2=
[ST][2024-02-06 19:54:46] HandleShellNotify::code=SHCNE_CREATE,itm1=E:\$RECYCLE.BIN\S-1-5-21-2415196247-1439118325-879051374-1001\$RGX2QHD.txt,itm2=
[ST][2024-02-06 19:54:46] ADD hNodePar=-1
6. Delete a folder:
Code:
[ST][2024-02-06 19:55:18] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=::{645FF040-5081-101B-9F08-00AA002F954E},itm2=
[ST][2024-02-06 19:55:18] UD Last=698219484,now=698251390,dif=31906
[ST][2024-02-06 19:55:18] nDev=2
[ST][2024-02-06 19:55:18] Got PortableDevice(0)=\\?\swd#wpdbusenum#{b2e29d5f-ec8b-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:55:18] Got PortableDevice(1)=\\?\swd#wpdbusenum#{3e477a54-ea61-11ed-9232-c403a8a72d39}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2024-02-06 19:55:18] HandleShellNotify::code=SHCNE_RMDIR,itm1=E:\MonitorDirTest\Neuer Ordner test,itm2=
[ST][2024-02-06 19:55:18] HandleShellNotify::code=SHCNE_RMDIR,itm1=E:\MonitorDirTest\Neuer Ordner test,itm2=
[ST][2024-02-06 19:55:18] HandleShellNotify::code=SHCNE_MKDIR,itm1=E:\$RECYCLE.BIN\S-1-5-21-2415196247-1439118325-879051374-1001\$RKAUMU0,itm2=
[ST][2024-02-06 19:55:18] HandleShellNotify::code=SHCNE_MKDIR,itm1=E:\$RECYCLE.BIN\S-1-5-21-2415196247-1439118325-879051374-1001\$RKAUMU0,itm2=
[ST][2024-02-06 19:55:18] ADD hNodePar=-1
[ST][2024-02-06 19:55:18] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 19:55:18] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=::{679F85CB-0220-4080-B29B-5540CC05AAB6},itm2=
[ST][2024-02-06 19:55:18] UD Last=698251390,now=698251562,dif=172
[ST][2024-02-06 19:55:18] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
Can you turn on the logs and look at what information it's receiving?
Windows 11 logs:
1. Creating a new folder in the empty folder "C:\test items" without changing the default folder name:
Code:
[ST][2024-02-06 14:02:20] HandleShellNotify::code=SHCNE_MKDIR,itm1=C:\test items\New folder,itm2=
[ST][2024-02-06 14:02:20] HandleShellNotify::code=SHCNE_MKDIR,itm1=C:\test items\New folder,itm2=
[ST][2024-02-06 14:02:20] ADD hNodePar=7223288
[ST][2024-02-06 14:02:20] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\New folder.lnk,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\New folder.lnk,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\New folder.lnk,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\New folder.lnk,itm2=
[ST][2024-02-06 14:02:21] ADD hNodePar=-1
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_MKDIR,itm1=Last Week,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_MKDIR,itm1=Last Week,itm2=
[ST][2024-02-06 14:02:21] ADD hNodePar=-1
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_MKDIR,itm1=Today,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_MKDIR,itm1=Today,itm2=
[ST][2024-02-06 14:02:21] ADD hNodePar=-1
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=Last Week,itm2=
[ST][2024-02-06 14:02:21] UD Last=0,now=23244250,dif=1001
[ST][2024-02-06 14:02:21] nDev=0
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_RMDIR,itm1=Sunday,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_RMDIR,itm1=Sunday,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_RMDIR,itm1=Sunday,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_RMDIR,itm1=Sunday,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_MKDIR,itm1=This PC,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_MKDIR,itm1=This PC,itm2=
[ST][2024-02-06 14:02:21] ADD hNodePar=-1
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_MKDIR,itm1=This PC,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_MKDIR,itm1=This PC,itm2=
[ST][2024-02-06 14:02:21] ADD hNodePar=-1
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_CREATE,itm1=New folder,itm2=
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_CREATE,itm1=New folder,itm2=
[ST][2024-02-06 14:02:21] ADD hNodePar=-1
[ST][2024-02-06 14:02:21] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:02:22] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:02:22] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:02:22] ADD hNodePar=-1
[ST][2024-02-06 14:02:22] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:02:22] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:02:22] ADD hNodePar=-1
[ST][2024-02-06 14:02:22] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:02:22] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:02:22] ADD hNodePar=-1
[ST][2024-02-06 14:02:22] HandleShellNotify::code=SHCNE_FREESPACE,itm1=,itm2=
[ST][2024-02-06 14:02:22] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 14:02:22] UD Last=23244250,now=23244750,dif=500
2. Creating a new folder and changing the default folder name:
Code:
[ST][2024-02-06 14:03:47] HandleShellNotify::code=SHCNE_MKDIR,itm1=C:\test items\New folder (2),itm2=
[ST][2024-02-06 14:03:47] HandleShellNotify::code=SHCNE_MKDIR,itm1=C:\test items\New folder (2),itm2=
[ST][2024-02-06 14:03:47] ADD hNodePar=7223288
[ST][2024-02-06 14:03:47] TVAddItem C:\test items\New folder (2)
[ST][2024-02-06 14:03:47] Add@44 C:\test items\New folder (2)
[ST][2024-02-06 14:03:47] WM_SETFOCUS pvSetIPAO Return
[ST][2024-02-06 14:03:47] WM_KILLFOCUS
[ST][2024-02-06 14:03:47] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_RENAMEFOLDER,itm1=C:\test items\New folder (2),itm2=C:\test items\New folder test
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_RENAMEFOLDER,itm1=C:\test items\New folder (2),itm2=C:\test items\New folder test
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\New folder test.lnk,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\New folder test.lnk,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\New folder test.lnk,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\New folder test.lnk,itm2=
[ST][2024-02-06 14:03:51] ADD hNodePar=-1
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_CREATE,itm1=New folder test,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_CREATE,itm1=New folder test,itm2=
[ST][2024-02-06 14:03:51] ADD hNodePar=-1
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_CREATE,itm1=New folder test,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_CREATE,itm1=New folder test,itm2=
[ST][2024-02-06 14:03:51] ADD hNodePar=-1
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_CREATE,itm1=New folder test,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_CREATE,itm1=New folder test,itm2=
[ST][2024-02-06 14:03:51] ADD hNodePar=-1
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_FREESPACE,itm1=,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:03:51] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 14:03:51] UD Last=23244750,now=23334312,dif=89562
[ST][2024-02-06 14:03:51] nDev=0
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\test items.lnk,itm2=
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_DELETE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\test items.lnk,itm2=
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\test items.lnk,itm2=
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent\test items.lnk,itm2=
[ST][2024-02-06 14:03:52] ADD hNodePar=-1
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:03:52] ADD hNodePar=-1
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:03:52] ADD hNodePar=-1
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_CREATE,itm1=test items,itm2=
[ST][2024-02-06 14:03:52] ADD hNodePar=-1
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_FREESPACE,itm1=,itm2=
[ST][2024-02-06 14:03:52] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\AppData\Roaming\Microsoft\Windows\Recent,itm2=
[ST][2024-02-06 14:03:52] UD Last=23334312,now=23334843,dif=531
3. Creating a new file without changing the default file name:
Code:
[ST][2024-02-06 14:04:18] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\test items\New Text Document.txt,itm2=
[ST][2024-02-06 14:04:18] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\test items\New Text Document.txt,itm2=
[ST][2024-02-06 14:04:18] ADD hNodePar=7223288
[ST][2024-02-06 14:04:18] TVAddItem C:\test items\New Text Document.txt
[ST][2024-02-06 14:04:18] Add@45 C:\test items\New Text Document.txt
[ST][2024-02-06 14:04:18] WM_SETFOCUS pvSetIPAO Return
[ST][2024-02-06 14:04:18] WM_KILLFOCUS
[ST][2024-02-06 14:04:18] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:04:19] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:04:19] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\Desktop,itm2=
[ST][2024-02-06 14:04:19] UD Last=23334843,now=23362062,dif=27219
[ST][2024-02-06 14:04:19] nDev=0
[ST][2024-02-06 14:04:19] HandleShellNotify::code=SHCNE_FREESPACE,itm1=,itm2=
4. Creating a new file and changing the default file name:
Code:
[ST][2024-02-06 14:04:43] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\test items\New Text Document (2).txt,itm2=
[ST][2024-02-06 14:04:43] HandleShellNotify::code=SHCNE_CREATE,itm1=C:\test items\New Text Document (2).txt,itm2=
[ST][2024-02-06 14:04:43] ADD hNodePar=7223288
[ST][2024-02-06 14:04:43] TVAddItem C:\test items\New Text Document (2).txt
[ST][2024-02-06 14:04:43] Add@46 C:\test items\New Text Document (2).txt
[ST][2024-02-06 14:04:43] WM_SETFOCUS pvSetIPAO Return
[ST][2024-02-06 14:04:43] WM_KILLFOCUS
[ST][2024-02-06 14:04:43] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:04:46] HandleShellNotify::code=SHCNE_RENAMEITEM,itm1=C:\test items\New Text Document (2).txt,itm2=C:\test items\New Text Document test.txt
[ST][2024-02-06 14:04:46] HandleShellNotify::code=SHCNE_RENAMEITEM,itm1=C:\test items\New Text Document (2).txt,itm2=C:\test items\New Text Document test.txt
[ST][2024-02-06 14:04:46] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:04:46] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:04:47] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\Desktop,itm2=
[ST][2024-02-06 14:04:47] UD Last=23362062,now=23389859,dif=27797
[ST][2024-02-06 14:04:47] nDev=0
[ST][2024-02-06 14:04:47] HandleShellNotify::code=SHCNE_FREESPACE,itm1=,itm2=
5. Delete a file in the folder "C:\test items":
Code:
[ST][2024-02-06 14:05:01] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\Desktop,itm2=
[ST][2024-02-06 14:05:01] UD Last=23389859,now=23404078,dif=14219
[ST][2024-02-06 14:05:01] nDev=0
[ST][2024-02-06 14:05:01] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
6. Delete a folder in the folder "C:\test items":
Code:
[ST][2024-02-06 14:05:18] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-06 14:05:18] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\Desktop,itm2=
[ST][2024-02-06 14:05:18] UD Last=23404078,now=23420781,dif=16703
[ST][2024-02-06 14:05:18] nDev=0
[ST][2024-02-06 14:05:18] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I'll try to take a look at it this week but as you can see it's no easy task figuring out what's going on there... part of the issue is the TreeView can't keep up with all those messages and things get screwed up in some very difficult to understand reliably reproduce way.
Might wind up just gutting the whole notification handling system and rewriting it.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Windows 11 logs:
7. Drag & Drop the folder "DragDropFolder" from the desktop into folder "C:\test items":
Code:
[ST][2024-02-07 00:21:00] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-07 00:21:00] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-07 00:21:00] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-07 00:21:00] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\Desktop,itm2=
[ST][2024-02-07 00:21:00] UD Last=23778921,now=23789187,dif=10266
[ST][2024-02-07 00:21:00] nDev=0
[ST][2024-02-07 00:21:00] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-07 00:21:02] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=::{4234D49B-0245-4DF3-B780-3893943456E1},itm2=
[ST][2024-02-07 00:21:02] UD Last=23789187,now=23791187,dif=2000
[ST][2024-02-07 00:21:02] nDev=0
7. Drag & Drop the file "DragDropFile.txt" from the desktop into folder "C:\test items":
Code:
[ST][2024-02-07 00:24:43] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
[ST][2024-02-07 00:24:43] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\adminENG\Desktop,itm2=
[ST][2024-02-07 00:24:43] UD Last=23984281,now=24011765,dif=27484
[ST][2024-02-07 00:24:43] nDev=0
[ST][2024-02-07 00:24:43] HandleShellNotify::code=SHCNE_EXTENDED_EVENT,itm1=,itm2=
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I thought I had put in a merged/timed refresh in response to SHCNE_UPDATEDIR... i.e. it receives one of those, waits a few seconds while it drops duplicate work, then does it? Is that broken? Or maybe I just did that in ucShellBrowse. Sorry, not at the computer right now, I'll try to take a look later.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Requirements
-Windows Vista or newer
ucShellTree is not compatible with Windows Vista and Windows Server 2008 R2 (based on Win7). I tested the control with both of them.
The minimum requirement is Windows 7 based on my tests.
Vista: "SHGetKnownFolderItem" isnt available in Shell32.dll
Server 2008 R2: ShellTree has stopped working:
Code:
Problem signature:
Problem Event Name: BEX
Application Name: ShellTree27.exe
Application Version: 2.7.0.11
Application Timestamp: 65bece8d
Fault Module Name: StackHash_1138
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 002d19f8
Exception Code: c0000005
Exception Data: 00000008
OS Version: 6.1.7601.2.1.0.272.7
Locale ID: 1033
Additional Information 1: 1138
Additional Information 2: 1138daeae5db9a70c91913ab164ba6b3
Additional Information 3: 8a4e
Additional Information 4: 8a4e7e87c8829836cef8cbe3ebed4c0b
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
ucShellTree is not working with Windows Server 2012 R2 too:
Attachment 190421
Windows crash reports:
Code:
Problem signature:
Problem Event Name: BEX
Application Name: ShellTree27.exe
Application Version: 2.7.0.11
Application Timestamp: 65bece8d
Fault Module Name: StackHash_bcb6
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: PCH_EE_FROM_ntdll+0x0003C66C
Exception Code: c0000005
Exception Data: 00000008
OS Version: 6.3.9600.2.0.0.272.7
Locale ID: 1033
Additional Information 1: bcb6
Additional Information 2: bcb682f64730b0db4397e16a2b1a5afb
Additional Information 3: 3810
Additional Information 4: 381073353f471203378ce39a533008b8
Code:
Problem signature:
Problem Event Name: BEX
Application Name: ShellTree293.exe
Application Version: 1.0.0.0
Application Timestamp: 65c1d01a
Fault Module Name: StackHash_1427
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: PCH_EE_FROM_ntdll+0x0003C66C
Exception Code: c0000005
Exception Data: 00000008
OS Version: 6.3.9600.2.0.0.272.7
Locale ID: 1033
Additional Information 1: 1427
Additional Information 2: 14277d6f451e304ee848b2871c687bb7
Additional Information 3: 1294
Additional Information 4: 1294b6e40503c8bd5a8283bda0f6c4a9
-
2 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
ucShellTree crashes with Windows Server 2016 too:
Attachment 190423
Attachment 190424
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
ucShellTree crashes with Server 2019 too.
It looks like all Windows server versions have a problem with the control.
Can you test this and hopefully find a fix for the problem?
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I found the reason why ucShellTree crashes on every Windows Server version:
The Data Execution Prevention option is always activated for all apps:
Attachment 190425
No crashes anymore after i switched the options to "Windows programs only".
I guess the used subclassing method is triggering this problem, or?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Ok there's something *really* bizarre going on with oleexp.tlb and Server 2019. I installed VB6 and tried to run from IDE; I'm getting a bunch of duplicated types. In the object browser, if I select oleexp, I see one of each. But left to all, it shows two of each of everything in oleexp, both showing as in oleexp.
I can't get past a type conflict where an API inside oleexp is apparently not expect oleexp.UUID. And there's no consistency or pattern with whether it wants qualified types or not. This is likely going to be beyond my skills to resolve.
Right now the only mitigation I can offer is the twinBASIC version, which doesn't rely on oleexp.tlb, is working on it.
---
Wrote the above before I saw your comment. Glad the binaries are working; *no idea* what's up with trying to compile it from source on Server2019 though.
Which subclassing method are you using? The original self-subclassing method for VB6 would definitely trigger a DEP violation, yes, so that explains it. And why the tB version works. But the VB6 version should work if you used the same subclassing method with the helper module with DEP still on, since it lacks the memory-executed assembly thunks that DEP hates.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
fafalone
Which subclassing method are you using? The original self-subclassing method for VB6 would definitely trigger a DEP violation, yes, so that explains it. And why the tB version works. But the VB6 version should work if you used the same subclassing method with the helper module with DEP still on, since it lacks the memory-executed assembly thunks that DEP hates.
Currently i use your original subclassing from v2.7 (ssc_Subclass). I want to switch to LaVolpe's Subclassing With Common Controls Library to avoid the crashes but im a little bit confused how to convert the following functions:
Code:
'@4
Private Sub FocusTimerProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal TimerID As Long, ByVal Tick As Long)
KillTimer hWnd, TimerID
If hWnd = hTVD Then DoSetFocus
End Sub
'@3 - This procedure must be third to last in this module
Private Sub LabelEditWndProc(ByVal bBefore As Boolean, ByRef bHandled As Boolean, ByRef lReturn As Long, _
ByVal lng_hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, _
ByRef lParamUser As Long)
'@2 - This procedure must be second to last in this module
Private Function TVSortProc(ByVal lParam1 As Long, ByVal lParam2 As Long, ByVal lParamSort As Long) As Long
I guess the code of this function:
Code:
'@1 - This procedure must be the last in this module
Private Sub ucWndProc(ByVal bBefore As Boolean, _
ByRef bHandled As Boolean, _
ByRef lReturn As Long, _
ByVal lng_hWnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long, _
ByRef lParamUser As Long)
must be placed in the new subclass function:
Code:
Private Function ISubclassEvent_ProcessMessage(ByVal Key As String, _
ByVal hWnd As Long, _
ByVal message As Long, _
wParam As Long, _
lParam As Long, _
Action As enumSubclassActions, _
WantReturnMsg As Boolean, _
ByVal ReturnValue As Long) As Long
and i have to convert the all the return values to match the different variables of the 2 sublass events...
Maybe its more easy to switch to Krools Subclassing to avoid code converting?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I decided to use Krool's Subclassing and transfered your Subclassing code from TwinBasic to VB6.
Currently im stuck with the AddressOf operator:
Code:
Subclass UserControl.hwnd, AddressOf ShellTreeSubclassProc, UserControl.hwnd, ObjPtr(Me)
the function "ShellTreeSubclassProc" is a private function inside the CTL so i cant use AddressOf.
When i move the function into a module -> no more access for all the private variables of the CTL.
Any ideas how to solve this?
I guess i need a public subclassProc in a module that redirects the subclass vars to CTL function "ShellTreeSubclassProc"?
Or how can i place the function "ShellTreeSubclassProc" in a module and have access to all variables of the CTL? "Friend"?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
You absolutely want an "ISubclass" interface that can be implemented separately wherever you need to process messages. That way, a single "SubclassProc" from a BAS module can access many subclass procs scattered all around your classes, forms or user controls.
In a BAS module:
Code:
Private Declare Function vbaObjSetAddref Lib "msvbvm60" Alias "__vbaObjSetAddref" (ByVal dstObject As Long, ByVal srcObject As Long) As Long
Private Declare Function SetWindowSubclass Lib "comctl32" Alias "#410" (ByVal hWnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long, ByVal dwRefData As Long) As Long
Private Declare Function GetWindowSubclass Lib "comctl32" Alias "#411" (ByVal hWnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long, pdwRefData As Long) As Long
Private Declare Function RemoveWindowSubclass Lib "comctl32" Alias "#412" (ByVal hWnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long) As Long
Private Declare Function DefSubclassProc Lib "comctl32" Alias "#413" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Function SubclassWnd(hWnd As Long, vSubclass As Variant, Optional dwRefData As Long, Optional bUpdateRefData As Boolean) As Boolean
Dim Subclass As ISubclass, uIdSubclass As Long, lOldRefData As Long
If IsObject(vSubclass) Then Set Subclass = vSubclass Else vbaObjSetAddref VarPtr(Subclass), vSubclass
uIdSubclass = ObjPtr(Subclass)
If Not IsWndSubclassed(hWnd, uIdSubclass, lOldRefData) Then
SubclassWnd = SetWindowSubclass(hWnd, AddressOf WndProc, uIdSubclass, dwRefData)
Else
If bUpdateRefData Then If lOldRefData <> dwRefData Then SubclassWnd = SetWindowSubclass(hWnd, AddressOf WndProc, uIdSubclass, dwRefData)
End If
End Function
Private Function UnSubclassWnd(hWnd As Long, uIdSubclass As Long) As Boolean
If IsWndSubclassed(hWnd, uIdSubclass) Then UnSubclassWnd = RemoveWindowSubclass(hWnd, AddressOf WndProc, uIdSubclass)
End Function
Private Function IsWndSubclassed(hWnd As Long, uIdSubclass As Long, Optional dwRefData As Long) As Boolean
IsWndSubclassed = GetWindowSubclass(hWnd, AddressOf WndProc, uIdSubclass, dwRefData)
End Function
Private Function WndProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal Subclass As ISubclass, ByVal dwRefData As Long) As Long
Dim bDiscardMessage As Boolean
Select Case uMsg
Case WM_NCDESTROY ' Remove subclassing as the window is about to be destroyed
UnSubclassWnd hWnd, ObjPtr(Subclass)
Case Else
WndProc = Subclass.WndProc(hWnd, uMsg, wParam, lParam, dwRefData, bDiscardMessage)
End Select
If Not bDiscardMessage Then WndProc = DefSubclassProc(hWnd, uMsg, wParam, lParam)
End Function
ISubclass.cls interface:
Code:
Public Function WndProc(hWnd As Long, uMsg As Long, wParam As Long, lParam As Long, dwRefData As Long, bDiscardMessage As Boolean) As Long
End Function
Now wherever you need to subclass something you just start with:
Code:
Implements ISubclass
This code is a lot simpler than LaVolpe's and eliminates the use of collection keys.
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
Quote:
Originally Posted by
VanGoghGaming
You absolutely want an "ISubclass" interface that can be implemented separately wherever you need to process messages. That way, a single "SubclassProc" from a BAS module can access many subclass procs scattered all around your classes, forms or user controls.
ucShellControl uses 4 SubclassProcs with different arg's:
Code:
Public Function ShellTreeSubclassProc(ByVal hWnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long, _
ByVal uIdSubclass As Long, _
ByVal dwRefData As Long) As Long
End Function
Public Sub ShellTreeFocusTimerProc(ByVal hWnd As Long, _
ByVal uMsg As Long, _
ByVal TimerID As Long, _
ByVal Tick As Long)
End Sub
Public Function ShellTreeTVSortProc(ByVal lParam1 As Long, _
ByVal lParam2 As Long, _
ByVal lParamSort As Long) As Long
End Function
Public Function ShellTreeLabelEditWndProc(ByVal hWnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long, _
ByVal uIdSubclass As Long, _
ByVal dwRefData As Long) As Long
Do i have to transfer them all into the ISubclass class or how should i use these different proc's with the ISubclass user interface "WndProc"?
Do you have an example project somewhere to see the practical use of your code?
-
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
I haven't studied the source code of ucShellControl but generally speaking you only need ONE subclass proc in each class module where you want to implement it and then you manage the code inside it using "Select Case" statements:
Code:
Private Function ISubclass_WndProc(hWnd As Long, uMsg As Long, wParam As Long, lParam As Long, dwRefData As Long, bDiscardMessage As Boolean) As Long
Select Case hWnd ' <-- outer "Select Case" branch only needed if you subclass more than one window in this module
Case hWndMainForm ' <-- just an example name
Select Case uMsg ' <-- inner "Select Case" branch, used to filter messages of interest
Case WM_WHATEVER
' ....
Case WM_ANOTHER
' ...
End Select
Case hWndTextBox1, hWndTextBox2, hWndTextBox3 ' <-- just example names
Select Case uMsg
Case WM_WHATEVER
' ....
Case WM_ANOTHER
' ...
End Select
' ...
End Select
' If you want to prevent Windows from processing a particular message do this inside one of the "Select Case" branches:
' bDiscardMessage = True: ISubclass_WndProc = lCustomValue ' only needed if you want to return a specific value and prevent this message from being passed on
End Function
Using this format I'm sure you can combine all those four functions above into this single "Select Case" statement!
Quote:
Originally Posted by
Mith
Do you have an example project somewhere to see the practical use of your code?
Yes, check out the Unicode InputBox sample from my signature below, the subclassing code is very short and uncluttered so it's easy to understand. For a more complex example using the same technique you can check out my RichEdit and MsftEdit Unicode TextBox project to see the subclassing proc managing messages for multiple windows.
As far as I've seen, subclassing is a kind of "touchy" subject and everyone has developed their own style and they frown upon other methods, so ultimately it is up to you which flavor is suitable for your own taste. In the end, they all accomplish the same result.
-
1 Attachment(s)
Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl
You'll find this helpful; it's the version I prepared for tB by first re-doing the subclass procs-- it's still a VB6 project, and runs in VB6, it's what I first imported into tB to make the transition. It uses the comctl6 SetWindowSubclass method like the tB version, only redirects things through a helper module.
Had some trouble finding this version, had to dig into backups.
The key is the helper BAS contains all of the IOleIPAO stuff from Krool, and these three redirects:
Code:
Public Function ShellTreeSortCallbackProc(ByVal lParam1 As Long, ByVal lParam2 As Long, ByVal lParamSort As ucShellTree) As Long
ShellTreeSortCallbackProc = lParamSort.zzz_TVSortProc(lParam1, lParam2)
End Function
Public Function ShellTreeSubclassProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal uIdSubclass As Long, ByVal dwRefData As ucShellTree) As Long
ShellTreeSubclassProc = dwRefData.zzz_WndProc(hWnd, uMsg, wParam, lParam, uIdSubclass)
End Function
Public Function ShellTreeLabelEditSubclassProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal uIdSubclass As Long, ByVal dwRefData As ucShellTree) As Long
ShellTreeLabelEditSubclassProc = dwRefData.zzz_LabelEditWndProc(hWnd, uMsg, wParam, lParam, uIdSubclass)
End Function
You can use AddressOf on those since they're in the BAS, and it passes an ObjPtr to the class as the user data parameter so it can be cast as a ucShellTree variable and used to call the actual implementation in the calling instance.
----
Now with tB in the game I think there is objective reason to frown on methods using assembly thunk hacks, as those can't run in tB :D (some can, but ones relying on undocumented VB internals hacks can't).