4

There's already a question about writing Shell Extensions up to Windows 10 here:

How to write a shell extension in C++?

Since Windows 11, the right-click context menu has changed:

Windows 11 Shell menu

A new Share menu has also been created:

Windows 11 Share menu

How do I create an entry in this new menu? I know that previous Shell Extensions are accessible via the "Show more options" entry, but that's not what I am looking for.

There is limited material on the Internet about this subject. So far, I have found:

  • This blog post about what possibilities Windows 11 offers and some limited information about involved classes. However it does not give enough information to get started.

  • This detailed article about how to do it. It gives step-by-step instructions on how to do it and provides an example, but it does not work.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Mickaël C. Guimarães
  • 1,020
  • 2
  • 14
  • 32
  • 1
    From the 1st blog: "*Apps extend the menu with `IExplorerCommand` + app identity. Unpackaged Win32 apps can use [Sparse Manifests](https://github.com/microsoft/AppModelSamples/tree/master/Samples/SparsePackages). `IExplorerCommand` support extends back to Windows 7... All apps can now participate in the Share dialog as targets. For unpackaged Win32 apps, this is covered in [the same sample](https://github.com/microsoft/AppModelSamples/tree/master/Samples/SparsePackages) as the context menu.*" Is something unclear about `IExplorerCommand`? It is not new. Did you look at the provided sample yet? – Remy Lebeau May 04 '22 at 19:20
  • @RemyLebeau Yes, I opened the example but can't run it. And I didn't find any other example, let alone detailed instructions on how to use IExplorerCommand. – Mickaël C. Guimarães May 04 '22 at 19:38
  • "*but can't run it*" - why not? Are you getting a compile-time error? A run-time error? Please be more specific. – Remy Lebeau May 04 '22 at 19:39
  • The example compiles correctly. But in order to run, according to its instructions, it needs to be packaged using MS packaging tools, and this final package needs to be signed. After that, the signed package needs to be installed, and then the example can be executed. I went through all that, including creating a self-signed certificate, creating the package and signing it, but Windows never accepts the signed package. – Mickaël C. Guimarães May 04 '22 at 19:51
  • On a side note, it is not impossible but will be hard and time consuming to go through this whole process each time I want to test the program. So I'm looking ideally for an example that can be tested easily, without needing packaging / installing. – Mickaël C. Guimarães May 04 '22 at 19:52
  • 1
    What about the part that says: "***Unpackaged** Win32 apps can use [Sparse Manifests](https://github.com/microsoft/AppModelSamples/tree/master/Samples/SparsePackages)*"? You shouldn't have to package/sign your program itself, only the Sparse Manifest it is associated with. Did you follow the links in the instructions to the [blog](https://aka.ms/sparsepkgblog) and [documentation](https://aka.ms/sparsepkgdocs) that cover this topic? – Remy Lebeau May 04 '22 at 20:01
  • 1
    @RemyLebeau The linked document asks to create an sign a package. I just tried to register manually the shell entries using their CSIDs from the AppxManifest.xml file but this doesn't work either. If you can specifly which steps need to be followed to have the example working, please post it as an answer and I'll gladly accept it! – Mickaël C. Guimarães May 05 '22 at 17:59
  • I don't know, as I've never worked with this API before. I'm simply going off what the documentation says. – Remy Lebeau May 05 '22 at 18:00

0 Answers0