Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit of WinUI3 Shell32 helpers <WIP> #494

Closed
wants to merge 5 commits into from

Conversation

tajbender
Copy link
Contributor

Initial commit of WinUI3 Shell32 helpers.

For Reference only.

Copy link
Contributor Author

@tajbender tajbender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a stub actually.

More coming soon.

@tajbender
Copy link
Contributor Author

tajbender commented Oct 25, 2024

Hello, @dahall

I'm working on the WinUI3 stuff using the brand new IconExtractor again.

When enumerating some special folders, the IconExtractor throws errors when then trying to get the DisplayName:

Code involved at public void ExtractChildItems( ... ):

        Debug.Assert(targetFolder.IsFolder);
        Debug.Assert(targetFolder.ShellItem.PIDL != null);
        var shItemId = targetFolder.ShellItem.PIDL;
        var shFolder = new ShellFolder(shItemId);
        var shellIconExtractor = new ShellIconExtractor(shFolder);
        shellIconExtractor.IconExtracted += (sender, args) =>
        {
            var shItem = new ShellItem(args.ItemID);
            var ebItem = new ExplorerBrowserItem(shItem);

            DispatcherQueue.TryEnqueue(() =>
            {
                CurrentFolderItems.Add(ebItem);
            });
        };
        shellIconExtractor.IconExtracted += iconExtOnIconExtracted;
        shellIconExtractor.Complete += iconExtOnComplete;
        shellIconExtractor.Start();

...

    public ExplorerBrowserItem(ShellItem? shItem, bool isSeparator = false)
    {
        ShellItem = new ShellItem(shItem.PIDL);
        DisplayName = ShellItem.Name ?? ":error: <DisplayName.get()>";
        IsExpanded = false;
        // todo: If IsSelected, add overlay of opened folder icon to TreeView optionally
        IsSelected = false;
    }

The folders that don't work are virtual ones: Home, This PC, Network.

You can (hopefully) build the branch involved from this:

You can see the result here:

Any ideas? Didn't debug into your code, cause I'm not privileged enough to understand it 🤣

Keep in mind, that there are no icons involved, no navigation is working ⚒

Any thoughts on this?

Thank you very much,
regards,
tajbender

@tajbender tajbender marked this pull request as draft October 25, 2024 08:32
@tajbender
Copy link
Contributor Author

You don't have to care. I'm bringing in Unit-Tests for this Issue, to track it down...

My 1st Unit Testing 👅 🥇

@tajbender tajbender closed this Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant