adding an item to Windows 11 Context Menu

Daniel Choi 26 Reputation points
2022-05-02T00:38:16.003+00:00

Hi, so I'm trying to add a menu item to the new windows 11 context menu.
Not the Windows 10 menu that shows up if I press "show more options" in the context menu, but the new one that appeared in windows 11

I've seen this blog post and I'm trying to do the "App example with many verbs" which creates a cascading menu.

Unfortunately, the program is an unpacked win32 app with context menu implemented using IContextMenu.
I've been doing alot of research, and I just wanted to confirm, or see if anyone knew how this worked.

From what I understand, in my situation, to add the context menu I want, I need to

  1. re-implement the context menu using IExplorerCommand Interface instead of the IContextMenu Interface
  2. Create a Sparse Package to give identity to the program.

Would this suffice to add a new menu to the Win11 Context Menu?

Also, I was kind of confused with sparse pacakges. I tried making one, and from waht I understand,
I create a MSIX file sign it with the certificate, and place the MSIX file inside my project folder?

Then, would the .dll module that gets installed with my product get identity and show up in the context menu?
The Sparse Package it self and changes made in Windows 11 is pretty confusing, and I was hoping I could get some clarifications.

Thanks.

Windows development Windows API - Win32
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} vote

Accepted answer
  1. Xiaopo Yang - MSFT 12,731 Reputation points Microsoft External Staff
    2022-05-02T02:06:30.567+00:00

    According to Grant identity to non-packaged desktop apps, Identity enables desktop apps to use Windows 10 extensibility features.

    In OS releases before Windows 10, version 2004, the only way to grant identity to a desktop app is to package it in a signed MSIX package. For these apps, identity is specified in the package manifest and identity registration is handled by the MSIX deployment pipeline based on the information in the manifest. All content referenced in the package manifest is present inside the MSIX package.

    Starting in Windows 10, version 2004, you can grant package identity to desktop apps that are not packaged in an MSIX package by building and registering a sparse package with your app. This support enables desktop apps that are not yet able to adopt MSIX packaging for deployment to use Windows 10 extensibility features that require package identity. For more background info, see this blog post.

    To extend the menu, use IExplorerCommand with app identity. For an example, please refer to SparsePackages.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.