Modern explorer system folder nodes not available in ShellTreeListBox/ShellListView

Shell for WPF Forum

Posted 2 years ago by Oliver Fink
Version: 22.1.0
Avatar

It seems the standard ShellObjects don't pick up modern explorer system folders like OneDrive Business and the WSL2 Linux environment:

(example from current demo)

I guess this coud be added using custom shell objects but ideally ShellTreeListBox and ShellListView to do the system level work.

Any chance this will be included automatically in an upcoming release to match the native file dialogs/explorer?

Comments (8)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Oliver,

If you go to our BrowseForFolder demo and put a breakpoint in OnCancelButtonClick, then run our sample and click the Cancel button, in the VS Watch window for a "treeListBox.RootShellFolder.Children" entry, do you see collection items for the OneDrive Business and WSL2 Linux environment?

That would tell us if the core shell logic is returning them, but they are getting filtered out by us at a higher level.  We do have some special case filtering in place to try and match Windows Explorer in general.


Actipro Software Support

Posted 2 years ago by Oliver Fink
Avatar

thanks for the quick reply, here is what I get there:

Count = 7
{Fr[SpecialFolderKind=QuickAccess; Name="Quick access"]}
{Fr[SpecialFolderKind=Computer; Name="This PC"]}
{Fr[SpecialFolderKind=Network; Name="Network"]}
{Fr[SpecialFolderKind=RecycleBin; Name="Recycle Bin"]}
{Fr[SpecialFolderKind=UsersFiles; Name="Oliver Fink"]}
{Fr[SpecialFolderKind=UsersLibraries; Name="Libraries"]}
{Fr[SpecialFolderKind=OneDrive; Name="OneDrive - Personal"]}
Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thank you for posting the results.  That list is effectively what I see for myself as well.  

Behind the scenes, our code is calling into IKnownFolderManager.GetFolder for the Desktop folder (FOLDERID_Desktop) and then we enumerate the shell objects there to get the results you listed.  I found another place where we are filtering out some extra results that normally shouldn't appear and I wonder if your two items are getting excluded there.

Please open our CustomShellObjects QuickStart and change the ShellTreeListBox.RootSpecialFolderKind="Default".  Then go to the CustomShellService.cs file and change the CreateObjectChildren override to this:

public override IList<IShellObject> CreateObjectChildren(IShellObject parentShellObject) {
	if (parentShellObject.SpecialFolderKind == SpecialFolderKind.Default) {
		var desktopFolder = this.CreateSpecialFolder(SpecialFolderKind.Desktop);
		if (desktopFolder != null) {
			var count = 0;
			foreach (var desktopChildObject in desktopFolder.Children) {
				System.Diagnostics.Debug.WriteLine($"{++count}: {desktopChildObject.Name} - {desktopChildObject.Kind} - {desktopChildObject.SpecialFolderKind} - {desktopChildObject.ParsingName}");
			}
		}
	}

	var results = base.CreateObjectChildren(parentShellObject);
			
	return results;
}

Run the QuickStart and see what prints in the VS Output.  That should be the full unfiltered list of items the Shell tells us is at the Desktop level.


Actipro Software Support

Posted 2 years ago by Oliver Fink
Avatar

yep, that one seems to find the other objects.

1: This PC - VirtualSpecialFolder - Computer - ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
2: Recycle Bin - VirtualSpecialFolder - RecycleBin - ::{645FF040-5081-101B-9F08-00AA002F954E}
3: Control Panel - Folder - None - ::{26EE0668-A00A-44D7-9371-BEB064C98683}
4: Oliver Fink - SpecialFolder - UsersFiles - C:\Users\olifi
5: Libraries - VirtualSpecialFolder - UsersLibraries - ::{031E4825-7B94-4DC3-B131-E946B44C8DD5}
6: Control Panel - VirtualObject - None - ::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}
7: Linux - Folder - None - ::{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}
8: Network - VirtualSpecialFolder - Network - ::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}
9: OneDrive - Personal - SpecialFolder - OneDrive - C:\Users\olifi\OneDrive
10: OneDrive - Re____ - Folder - None - C:\Users\olifi\OneDrive - Re____
11: hello.db - File - None - C:\Users\olifi\Desktop\hello.db
12: test.license - File - None - C:\Users\olifi\Desktop\test.license
13: Microsoft Edge - Link - None - C:\Users\Public\Desktop\Microsoft Edge.lnk
Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Oliver,

Ok, so yes it's our WindowsShellService.CreateObjectChildren method that is filtering them out.  We are currently filtering out child objects with a Kind == Folder to avoid some folders from being included.  That being said, I think we found a way to be more exact with that filter and allow some of these other special ones.

Can you do the same thing but re-run it, replacing the debug output of ParsingName with RelativeParsingName, and post the results?


Actipro Software Support

Posted 2 years ago by Oliver Fink
Avatar

not a problem - here it is with RelativeParsingName

1: This PC - VirtualSpecialFolder - Computer - ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
2: Recycle Bin - VirtualSpecialFolder - RecycleBin - ::{645FF040-5081-101B-9F08-00AA002F954E}
3: Control Panel - Folder - None - ::{26EE0668-A00A-44D7-9371-BEB064C98683}
4: Oliver Fink - SpecialFolder - UsersFiles - ::{59031A47-3F72-44A7-89C5-5595FE6B30EE}
5: Libraries - VirtualSpecialFolder - UsersLibraries - ::{031E4825-7B94-4DC3-B131-E946B44C8DD5}
6: Control Panel - VirtualObject - None - ::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}
7: Linux - Folder - None - ::{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}
8: Network - VirtualSpecialFolder - Network - ::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}
9: OneDrive - Personal - SpecialFolder - OneDrive - ::{018D5C66-4533-4307-9B53-224DE2ED1FE6}
10: OneDrive - Re____ - Folder - None - ::{04271989-C4D2-EAA9-D5A5-0C45F29C033C}
11: hello.db - File - None - hello.db
12: test.license - File - None - test.license
Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thank you.  Ok good, I think the code we added will work for you then.  If you want to test a preview build to make sure it works, please email our support address and reference this thread.


Actipro Software Support

Posted 2 years ago by Oliver Fink
Avatar

thanks for your help! will do

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.