About five years back, I wrote a program for a customer which effectively re-created the Windows Explorer context menu inside the program -- if they clicked on the object representing their data file, it showed the context menu they'd see in Explorer, including the Dropbox sharing menu items. (The mechanism is similar to the one here: https://github.com/linquize/explorerplus-custom/blob/master/Explorer%2B%2B/Helper/ContextMenuManager.cpp -- finding all the IContextMenu COM objects from the registry and querying each in term to add their menu items.)
This has worked fine all this time... but Windows 11 has changed things, and the new version of the Dropbox client (v159) has broken backwards compatibility.
To sum up, the old-style IContextMenu COM objects could all be queried under HKEY_CLASSES_ROOT*\shellex\ContextMenuHandlers (or similar locations), but the new short-form context menu on Win11 uses IExplorerCommand objects instead. Explorer includes them on the old-style context menu as well as the IContextMenu iterations -- in Dropbox's case this led to a bug which caused the menu items to be duplicated. They seem to have just fixed this in v159 by suppressing the IContextMenu items... meaning they don't show up in my menu any more.
So how can I find and iterate all the IExplorerCommand objects which are added to the new short-form context menu? Including the cloud-provider commands from apps like Dropbox?
For what it's worth, I can find class IDs for the Dropbox items in their AppxManifest.xml:
<Extensions>
<desktop3:Extension Category="windows.cloudFiles">
<desktop3:CloudFiles>
<desktop3:CloudFilesContextMenus>
<desktop3:Verb Id="Dropbox01UpgradeCommand"
Clsid="F3BC3DAF-431B-4F0E-B105-E9BB76335840" />
<desktop3:Verb Id="Dropbox02ShareCommand"
Clsid="7F4C5B83-2680-40AF-9AE9-2161AA759EF2" />
And it also defines the COM server they're running on:
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:SurrogateServer AppId="67233DFC-D70F-4D8E-A068-6877D86826BC"
DisplayName="ms-resource:ShellExtensionServerDisplayName">
<com:Class Id="7F4C5B83-2680-40AF-9AE9-2161AA759EF2"
Path="DropboxExt64.55.0.dll" ThreadingModel="STA" />
<com:Class Id="F3BC3DAF-431B-4F0E-B105-E9BB76335840"
Path="DropboxExt64.55.0.dll" ThreadingModel="STA" />
And these entries are visible under HKEY_CLASSES_ROOT\PackagedCom, e.g:
[HKEY_CLASSES_ROOT\PackagedCom\Package\DropboxInc.Dropbox_159.4.5870.0_x86__wkt425jdc3sga\Server\0] [HKEY_CLASSES_ROOT\PackagedCom\Package\DropboxInc.Dropbox_159.4.5870.0_x86__wkt425jdc3sga\Class{7F4C5B83-2680-40AF-9AE9-2161AA759EF2}] [HKEY_CLASSES_ROOT\PackagedCom\Package\DropboxInc.Dropbox_159.4.5870.0_x86__wkt425jdc3sga\Class{F3BC3DAF-431B-4F0E-B105-E9BB76335840}]
...but I can't even co-create an IUnknown for any of these class IDs -- even within a shell extension running within Windows Explorer, let alone my own app. I get an HRESULT error 0x80040154 (-2147221164)
Basically, how do I locate these items? (Note that if I use ICatInformation::EnumClassesOfCategories(), the Dropbox items aren't defined with category information.) If there's no way to construct a complete list, is there at least a way to access known objects like the Dropbox ones?