Page 5 of 6 FirstFirst ... 23456 LastLast
Results 161 to 200 of 223

Thread: [VB6] ucShellTree - Full-featured Shell Tree UserControl

  1. #161
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    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. #162
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    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.

    Name:  MonitorDirChanges_rename.png
Views: 2635
Size:  11.1 KB


    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:

    Name:  MonitorDirChanges_wrongicon.png
Views: 2623
Size:  13.4 KB

    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

  3. #163

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    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).

  4. #164
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    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=
    Last edited by Mith; Feb 6th, 2024 at 08:06 AM.

  5. #165
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    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=
    Last edited by Mith; Feb 6th, 2024 at 06:26 PM.

  6. #166

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    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.

  7. #167
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    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=

  8. #168

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    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.

  9. #169
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    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
    Last edited by Mith; Feb 9th, 2024 at 12:03 AM.

  10. #170
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    ucShellTree is not working with Windows Server 2012 R2 too:

    Name:  Server2012.jpg
Views: 2635
Size:  28.2 KB

    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

  11. #171
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    ucShellTree crashes with Windows Server 2016 too:

    Name:  winserver2016.jpg
Views: 2564
Size:  28.6 KB

    Name:  winserver2016_.jpg
Views: 2632
Size:  25.1 KB

  12. #172
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    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?

  13. #173
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    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:

    Name:  Data Execution Prevention.jpg
Views: 2572
Size:  34.2 KB

    No crashes anymore after i switched the options to "Windows programs only".

    I guess the used subclassing method is triggering this problem, or?

  14. #174

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    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.
    Last edited by fafalone; Feb 9th, 2024 at 05:59 AM.

  15. #175
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    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?

  16. #176
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    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"?

  17. #177
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,022

    Talking 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.

  18. #178
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by VanGoghGaming View Post
    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?

  19. #179
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,022

    Lightbulb 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 View Post
    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.

  20. #180

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    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 (some can, but ones relying on undocumented VB internals hacks can't).
    Attached Files Attached Files
    Last edited by fafalone; Feb 9th, 2024 at 11:37 AM.

  21. #181
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,022

    Question Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Is subclassing done differently in tB since you mentioned a "tB version"? Is it because tB can use the "AddressOf" operator with class methods, right? That surely does come in handy...

  22. #182

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Not just that, but self-subclassing techniques like the one originally used in the VB6 version (Paul Caton/LaVolpe ssc_Subclass), rely on assembly thunks that use undocument internal VB implementation hacks. Since tB isn't a just a reverse engineered VB, the internals differ, so the the self-sub thunks can't be used.

    However tB supporting AddressOf on classes natively eliminates the need for such a hack, so you can replace it with more simple methods like SetWindowSubclass and direct callbacks. I did write a tB FAQ entry that clarifies that 'full compatibility' doesn't include undocumented internal implementation details.

  23. #183
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    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.
    Krool's subclassing works now with ucShellTree!

    I also had to add another subclassing function for the FocusTimer:

    Code:
    CTL:
    Public Function zzz_FocusTimerProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal TimerID As Long, ByVal Tick As Long) As Long
    
    MOD:
    Public Function ShellTreeFocusTimerProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal TimerID As Long, ByVal Tick As Long, ByVal lFocusTimer As ucShellTree)
    ShellTreeFocusTimerProc = lFocusTimer.zzz_FocusTimerProc(hWnd, uMsg, TimerID, Tick)
    End Function
    ucShellTree runs now without crashes on Windows Server editions with a strict DEP option.

    I tested the LabelEdit with a file and the IDE/exe is crashing when i rename the file.
    The crash happens in the RenameFile function.
    No crash occurred if i enter the label edit mode and not rename the file.

    I guess this has something to do with the subclassing.

    With ucShellTree v2.7 you unsubclassed the edit control at the beginning of TVN_ENDLABELEDITW in the function "ucWndProc".
    The newer version do the unsubclass in the function "zzz_LabelEditWndProc" at WM_DESTROY.

    Any ideas whats wrong here?

  24. #184

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Yeah I think I added the focus timer stuff in a later version. You did it right, same as the others.


    I'll try to take a look at the rename issue, but really you're getting just as good at working on ucShellTree as me

  25. #185
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    I'll try to take a look at the rename issue, but really you're getting just as good at working on ucShellTree as me
    It's never easy to maintain the code of a other dev but i try my best

  26. #186
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    At Windows Server 2008 R2 i want to open the existing path "C:\Users\Administrator\AppData\Local\Temp\1" using ucTree.OpenToPath but it doesnt work because the folder "AppData" is hidden in the tree:

    Name:  Win2008R2_appdata_hidden.jpg
Views: 2649
Size:  37.0 KB

    Control properties:

    Code:
    ucTree.Autocheck = False
    ucTree.AutoExpandComputer = False
    ucTree.AutoExpandLibraries = False
    ucTree.BorderStyle = STBS_None
    ucTree.ComputerAsRoot = False
    ucTree.DisableDragDrop = True
    ucTree.DisableWow64Redirect = True
    ucTree.EnableShellMenu = False
    ucTree.ExclusionChecks = False
    ucTree.ExpandZip = False
    ucTree.FileExtensions = STEP_AlwaysShow
    ucTree.HideControlPanel = True
    ucTree.HideLibraries = False
    ucTree.HideNetwork = False
    ucTree.HideOneDrive = True
    ucTree.HideRecycleBin = True
    ucTree.IconSize = 16
    ucTree.InfoTipOnFiles = False
    ucTree.InfoTipOnFolders = False
    ucTree.ItemFilterFilesOnly = True
    ucTree.LabelEditRename = False
    ucTree.MonitorDirChanges = False
    ucTree.MultiSelect = False
    ucTree.PlayNavigationSound = False
    ucTree.RootHasCheckbox = False
    ucTree.ShowFavorites = False
    ucTree.ShowHiddenItems = STHP_AlwaysShow
    ucTree.ShowOnlyDrives = False
    ucTree.ShowOnlyFileCheckbox = True
    ucTree.ShowQuickAccessOnWin10 = False
    ucTree.ShowSelAlways = True
    ucTree.ShowSuperHidden = STSHP_AlwaysShow
    ucTree.SingleClickExpand = True
    ucTree.SingleExpand = False
    How to make the hidden folder visible?

  27. #187
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    It seems thats the ShowHiddenItems/ShowSuperHidden properties not work correct with Server2008R2.

    The folder is visible after i manually unide the items via the explorer configuration:

    Name:  Win2008R2_appdata_unhidden.jpg
Views: 2636
Size:  40.2 KB

    I will check this with other Server versions too...stay tuned

  28. #188
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    The problem with the hidden folder "AppData" goes along with Server2008R2, Server20212, Server2019 and Server2022.

    Starting the exe with full admin rights doesnt change anything.

    The folder isnt visible until i turn on hidden items for the windows explorer.

    The control properties ShowHiddenItems/ShowSuperHidden have no effect.

    Can this be fixed?

  29. #189
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    oh well, oh well, the AppData folder is also hidden with all workstation versions (7,8,10,11)!

    Do the Shell APIs have to follow the Windows Explorer settings regarding the visible folder/file option or is this a bug in the code?

  30. #190
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    I guess i found the problem: in the function TVExpandFolder at line "siParent.BindToHandler 0&, BHID_EnumItems, IID_IEnumShellItems, pEnum" you init the enum object to get all items from a parent folder but i cant find the settings for the enum object using "STR_ENUM_ITEMS_FLAGS".

    STR_ENUM_ITEMS_FLAGS
    Introduced in Windows 8. Specifies a SHCONTF value to be passed to IShellFolder::EnumObjects when you call IShellItem::BindToHandler with BHID_EnumItems.
    See:

    - win32/desktop-src/shell/str-constants
    - Customizing item enumeration with IShellItem
    - Customizing item enumeration with IShellItem, the old-fashioned way

    This infos should help you to add the enum items flags and make the properties ShowHiddenItems/ShowSuperHidden work correctly!

  31. #191

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    It seems the shell item enums do work differently on the server editions; the initial enum doesn't include the hidden items like regular editions.

    I was already writing that bind context function to test that out (I found out I didn't have *any* PSPropertyBag_ APIs written so I got distracted by that; so won't get around to testing until tomorrow now)... but the problem is that's only good for Windows 8 and up. 7 is still pretty popular among VB6 users.

    The other method is just falling back to IShellFolder/IEnumIDList, which has its own drawbacks.

  32. #192
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    but the problem is that's only good for Windows 8 and up. 7 is still pretty popular among VB6 users.
    please read the above again

    We are not developing a usercontrol for VB6 users. The control will be used in an app by end-users that are mostly using Windows 10 and Windows 11:

    Desktop Windows Version Market Share Worldwide - January 2024

    Win10 66.45%
    Win11 27.83%
    Win7 3.06%
    Win8.1 1.74%

  33. #193

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    If you don't need Win7 then yeah, bind context is a good option. But I couldn't do that for the main release except as maybe an optional that just proceeded normally if the call failed with the bindctx.

  34. #194
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    If you don't need Win7 then yeah, bind context is a good option. But I couldn't do that for the main release except as maybe an optional that just proceeded normally if the call failed with the bindctx.
    IF Win8 or Higher = True THEN use bindctx ELSE fall back to current standard

    or add a new property like "ShowSuperMegaHiddenItems" that is available with Win8 or higher

    ShowSuperMegaHiddenItems = false ' use the current standard
    ShowSuperMegaHiddenItems = True ' use bindctx

    btw, all my apps support Win7/Server2008R2 or higher.

  35. #195

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Bad news I'm afraid... I got the bind context working fine; I tested it with include only folders and sure enough no files were enumerated. But it ignored the include hidden/superhidden flags, even while running as admin. I suspect there's a policy setting somewhere that's controlling this.

    I didn't add conditionals since it was just a preliminary test;

    Code:
    Public Declare PtrSafe Function CreateBindCtx Lib "ole32" (ByVal reserved As Long, ppbc As IBindCtx) As Long
    Public Declare PtrSafe Function PSCreateMemoryPropertyStore Lib "propsys" (riid As UUID, ppv As Any) As Long
    Public Declare PtrSafe Function PSPropertyBag_WriteDWORD Lib "propsys" (ByVal propBag As IPropertyBag, ByVal propName As LongPtr, ByVal value As Long) As Long
    
    
    
        Dim pbc As IBindCtx
        Dim hrbc As Long: hrbc = CreateBindCtx(0, pbc)
        If (pbc Is Nothing) = False Then
            Dim sppb As IPropertyBag
            Dim spunk As IUnknownUnrestricted 'oleexp.IUnknown in VB6
            hrbc = PSCreateMemoryPropertyStore(IID_IUnknown, spunk)
            If SUCCEEDED(hrbc) Then
                pbc.RegisterObjectParam StrPtr(STR_PROPERTYBAG_PARAM), spunk 
                Set sppb = spunk
                If (sppb Is Nothing) = False Then
                    PSPropertyBag_WriteDWORD sppb, StrPtr(STR_ENUM_ITEMS_FLAGS), SHCONTF_FOLDERS Or SHCONTF_INCLUDEHIDDEN Or SHCONTF_INCLUDESUPERHIDDEN 
                    Debug.Print "Wrote BindCtx dw"
                Else
                    Debug.Print "QI for PropertyBag failed"
                End If
            Else
                Debug.Print "PSCreateMemPstore failed"
            End If
            siParent.BindToHandler ObjPtr(pbc), BHID_EnumItems, IID_IEnumShellItems, pEnum
        Else
            siParent.BindToHandler 0, BHID_EnumItems, IID_IEnumShellItems, pEnum
        End If
    The only alternative I can see at this point is toggling the explorer setting; I doubt IShellFolder would help here since SHCONTF flags are being ignored, and other enum methods wouldn't work with all the virtual objects like ThisPC. It would be possible to do like ucShellBrowse and have a different enum method available only for regular file system paths, but that's major rewrite territory; I'd be inclined to just tell users ucShellTree respects your settings here, deal with it. You could offer to toggle it permanently or per-run; if you're considering per-enum then I'd check whether changing it triggers a refresh of open windows; that could really interfere with the smoothness of it.
    Last edited by fafalone; Feb 10th, 2024 at 06:28 PM.

  36. #196
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    Bad news I'm afraid... I got the bind context working fine; I tested it with include only folders and sure enough no files were enumerated. But it ignored the include hidden/superhidden flags, even while running as admin. I suspect there's a policy setting somewhere that's controlling this.
    Check this code to use hidden/superhidden flags:

    Code:
       
    ...
       hr = SHCreateItemFromIDList(pidlRoot, IID_IShellItem, pISI)
    
       hr = pISI.BindToHandler(0, BHID_SFObject, IID__IShellFolder, pISF)
    
       hr = pISF.EnumObjects(0, SHCONTF_CHECKING_FOR_CHILDREN Or SHCONTF_ENABLE_ASYNC Or SHCONTF_FASTITEMS Or SHCONTF_FLATLIST Or _
                                                SHCONTF_FOLDERS Or SHCONTF_INCLUDEHIDDEN Or SHCONTF_INCLUDESUPERHIDDEN Or SHCONTF_INIT_ON_FIRST_NEXT Or _
                                                SHCONTF_NAVIGATION_ENUM Or SHCONTF_NETPRINTERSRCH Or SHCONTF_NONFOLDERS Or SHCONTF_SHAREABLE Or _
                                                SHCONTF_STORAGE, pEIDL)
       
       If hr = S_OK Then
          Do While pEIDL.Next(1, pidlEnum, 0) = S_OK
    ...
    Full code here:
    https://www.vbforums.com/showthread....it-s-to-slow!!

    I did not test it, but it looks much more easy to implement the flags!

  37. #197
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    I tried to test the other enum method but BindToHandler returns always -2147467262 and i get no IShellFolder object.
    Maybe my def of IID_IShellFolder is wrong?

    Code:
    Private Function IID_IShellFolder() As oleexp.UUID
    '{000214E6-0000-0000-C000-000000046}
    Static iid As oleexp.UUID
    If (iid.Data1 = 0) Then Call DEFINE_UUID(iid, &H214E6, CInt(&H0), CInt(&H0), &HC0, &H0, &H0, &H0, &H0, &H0, &H0, &H46)
    IID_IShellFolder = iid
    End Function
    new enum method:

    Code:
    If (siParent Is Nothing) = False Then
        
       Dim pISF As oleexp.IShellFolder
       Dim pEIDL As oleexp.IEnumIDList
       Dim pidlEnum As Long
       Dim lReturn As Long
       lReturn = siParent.BindToHandler(0&, BHID_SFUIObject, IID_IShellFolder, pISF) ' returns -2147467262
       If (pISF Is Nothing) = False Then
          lReturn = pISF.EnumObjects(UserControl.hWnd, SHCONTF_CHECKING_FOR_CHILDREN Or _
                            SHCONTF_FOLDERS Or _
                            SHCONTF_NONFOLDERS Or _
                            SHCONTF_INCLUDEHIDDEN Or _
                            SHCONTF_SHAREABLE Or _
                            SHCONTF_STORAGE Or _
                            SHCONTF_NAVIGATION_ENUM Or _
                            SHCONTF_FASTITEMS Or _
                            SHCONTF_INCLUDESUPERHIDDEN, _
                            pEIDL)
       End If
    
          If (pEIDL Is Nothing) = False Then
             bFilling = True
             tc1 = GetTickCount()
             Do While pEIDL.Next(1&, pidlEnum, pcl) = S_OK
                oleexp.SHCreateItemFromIDList pidlEnum, IID_IShellItem, siChild
    the above code replaced the original code:

    Code:
        siParent.BindToHandler 0&, BHID_EnumItems, IID_IEnumShellItems, pEnum
        If (pEnum Is Nothing) = False Then
    
            bFilling = True
            tc1 = GetTickCount()
            Do While pEnum.Next(1&, siChild, pcl) = S_OK
    Do you see whats wrong here?

  38. #198
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    I fixed the problem with the error at BindToHandler: the other enum method uses BHID_SFObject with BindToHandler but the ucShellTree project doesnt know about this UUID. I can only chosse between BHID_DataObject, BHID_EnumItems and BHID_SFUIObject.

    I added BHID_SFObject to solve the error:

    Code:
    Private Function BHID_SFObject() As oleexp.UUID
    'https://doxygen.reactos.org/d0/d95/shlguid_8h.html
    'DEFINE_GUID (BHID_SFObject, 0x3981E224, 0xF559, 0x11D3, 0x8E, 0x3A, 0x00, 0xC0, 0x4F, 0x68, 0x37, 0xD5)
    Static iid As oleexp.UUID
    If (iid.Data1 = 0) Then Call DEFINE_UUID(iid, &H3981E224, CInt(&HF559), CInt(&H11D3), &H8E, &H3A, &H0, &HC0, &H4F, &H68, &H37, &HD5)
    BHID_SFObject = iid
    End Function
    Now i can run ucShellTree with the other enum method and the content of the desktop is fully enumerated and looks correct BUT:

    - "This PC" is enumerated but only showing empty item names and the standard file icon.
    - I can expand my HD drive D: but some folders (with subfolders) on this drive cannot expanded.
    - i cannot expand my HD drive F: ...

    Strange behavior...

    I wish i could see my C: drive in the tree to test if the hidden AppData folder is now visible or not!

    For me it looks like this enum method only works with real folders but not with GUID items.

    What do you think?
    Last edited by Mith; Feb 10th, 2024 at 09:50 PM.

  39. #199

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,269

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    I'm 99% sure IEnumShellItems is just implementing IShellFolder/IEnumIDList under the hood. As expected, it too ignored those flags. Not sure where you're going wrong, must be with the IIDs (I strongly advise against copying code from nebeln; he's had IID issues and others from his weird need to rewrite everything to avoid doing it the same way as me and all the giants I learned from). If you want to try yourself:

    Code:
    Public Declare Function ILCombine Lib "shell32" (ByVal pidl1 As LongPtr, ByVal pidl2 As LongPtr) As LongPtr
    Public Function BHID_SFObject() As UUID
    '{0x3981E224, 0xF559, 0x11D3, 0x8E,0x3A, 0x00,0xC0,0x4F,0x68,0x37,0xD5}
    Static iid As UUID
     If (iid.Data1 = 0) Then Call DEFINE_UUID(iid, &H3981E224, &HF559, &H11D3, &H8E, &H3A, &H0, &HC0, &H4F, &H68, &H37, &HD5)
     BHID_SFObject = iid
    End Function
    Public Function IID_IShellFolder() As UUID
      Static iid As UUID
      If (iid.Data1 = 0) Then Call DEFINE_OLEGUID(iid, &H214E6, 0, 0)
      IID_IShellFolder = iid
    End Function
    Public Sub DEFINE_OLEGUID(Name As UUID, L As Long, w1 As Integer, w2 As Integer)
      DEFINE_UUID Name, L, w1, w2, &HC0, 0, 0, 0, 0, 0, 0, &H46
    End Sub
    
    
        Dim psfp As IShellFolder
        Dim peil As IEnumIDList
        Dim pidlEnum As LongPtr
        Dim pidlPar1 As LongPtr
        Dim ppil As IPersistIDList
        Set ppil = siParent
        ppil.GetIDList pidlPar
        Dim hrbh As Long: hrbh = siParent.BindToHandler(0, BHID_SFObject, IID_IShellFolder, psfp)
        If (psfp Is Nothing) = False Then
            psfp.EnumObjects 0, SHCONTF_FOLDERS Or SHCONTF_INCLUDEHIDDEN Or SHCONTF_INCLUDESUPERHIDDEN, peil
        Else
            Debug.Print "Failed to get IShellFolder for siParent; 0x" & Hex$(hrbh)
            Exit Sub
        End If
     
    
        If (peil Is Nothing) = False Then
           bFilling = True
           tc1 = GetTickCount()
           Do While peil.Next(1&, pidlEnum, pcl) = S_OK
              SHCreateItemFromIDList ILCombine(pidlPar, pidlEnum), IID_IShellItem, siChild
    Note: That code is just to test whether the flags work; it's light on error handling and heavy on memory leaks.


    Edit: You ninja'd me by a few minutes. Your new problems likely come from the other problem your code had you didn't get to yet; IEnumIDList gives relative pidls, you need to combine them with the pidl of the parent you're enumerating.
    Last edited by fafalone; Feb 10th, 2024 at 09:46 PM.

  40. #200
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    455

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    Edit: You ninja'd me by a few minutes. Your new problems likely come from the other problem your code had you didn't get to yet; IEnumIDList gives relative pidls, you need to combine them with the pidl of the parent you're enumerating.
    Great, it works now!

    The hidden AppData folder is now visible!

    Replace this in TVExpandFolder:

    Code:
        siParent.BindToHandler 0&, BHID_EnumItems, IID_IEnumShellItems, pEnum
        If (pEnum Is Nothing) = False Then
    
            bFilling = True
            tc1 = GetTickCount()
            Do While pEnum.Next(1&, siChild, pcl) = S_OK
    with this:

    Code:
       Dim pISF As oleexp.IShellFolder
       Dim pEIDL As oleexp.IEnumIDList
       Dim pidlEnum As Long
       Dim lReturn As Long
       Dim ppil As IPersistIDList
       Set ppil = siParent
       ppil.GetIDList pidlPar
       lReturn = siParent.BindToHandler(0&, BHID_SFObject, IID_IShellFolder, pISF)
       If (pISF Is Nothing) = False Then
          lReturn = pISF.EnumObjects(0, _
                            SHCONTF_CHECKING_FOR_CHILDREN Or _
                            SHCONTF_FOLDERS Or _
                            SHCONTF_NONFOLDERS Or _
                            SHCONTF_INCLUDEHIDDEN Or _
                            SHCONTF_SHAREABLE Or _
                            SHCONTF_STORAGE Or _
                            SHCONTF_NAVIGATION_ENUM Or _
                            SHCONTF_FASTITEMS Or _
                            SHCONTF_INCLUDESUPERHIDDEN, _
                            pEIDL)
       End If
    
          If (pEIDL Is Nothing) = False Then
             bFilling = True
             tc1 = GetTickCount()
             Do While pEIDL.Next(1&, pidlEnum, pcl) = S_OK
                oleexp.SHCreateItemFromIDList ILCombine(pidlPar, pidlEnum), IID_IShellItem, siChild
    Other necessary code addings:

    Code:
    Private Function IID_IShellFolder() As oleexp.UUID
    '{000214E6-0000-0000-C000-000000046}
    Static iid As oleexp.UUID
    If (iid.Data1 = 0) Then Call DEFINE_UUID(iid, &H214E6, CInt(&H0), CInt(&H0), &HC0, &H0, &H0, &H0, &H0, &H0, &H0, &H46)
    IID_IShellFolder = iid
    End Function
    Private Function BHID_SFObject() As oleexp.UUID
    'https://doxygen.reactos.org/d0/d95/shlguid_8h.html
    'DEFINE_GUID (BHID_SFObject, 0x3981E224, 0xF559, 0x11D3, 0x8E, 0x3A, 0x00, 0xC0, 0x4F, 0x68, 0x37, 0xD5)
    Static iid As oleexp.UUID
    If (iid.Data1 = 0) Then Call DEFINE_UUID(iid, &H3981E224, CInt(&HF559), CInt(&H11D3), &H8E, &H3A, &H0, &HC0, &H4F, &H68, &H37, &HD5)
    BHID_SFObject = iid
    End Function

Page 5 of 6 FirstFirst ... 23456 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width