Context menu handler for folders

做~自己de王妃 提交于 2020-01-07 02:16:45

问题


I am trying to wrap my head around Microsoft's shell extension context menu handler example.

Its implementation only shows a context menu on a .cpp file right-click. I want to try to extend it to allow it to show the context menu whenever a folder, drive, or empty space is right-clicked in Explorer as well.

So far I was only able to modify it to register right-clicks for all file types, not just .cpp files by specifying * when registering it:

hr = RegisterShellExtContextMenuHandler(L"*", 
            CLSID_FileContextMenuExt, 
            L"CppShellExtContextMenuHandler.FileContextMenuExt");

I must be missing something else because it won't pop up for folders. I have tried this suggestion but it did not work.

How can I extend this sample to also have it work for folders? Am I missing something from the registry?

Edit: Thanks to Igor's suggestion, I got it to work for folders and drives, but it does not show up when you right-click the desktop or when you right click blank space in a folder, and I did register for Directory\Background and DesktopBackground. Why is this?

来源:https://stackoverflow.com/questions/38024597/context-menu-handler-for-folders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!