Adding item to the Desktop context menu in Windows

故事扮演 提交于 2019-12-19 04:21:11

问题


I want to add an item into the Desktop context menu (the menu you see when you right-click on an empty space on the Windows Desktop).

Something like Catalyst Control Center in this screenshot:

I know how to add items to files' and folders' context menus through registry, but the Desktop seems to work differently: I didn't even find the text in the registry.

So, how can I add a new item into the Desktop menu and how can I associate some code with it?
I think the solution is language independent, if it's not, I'd appreciate any code that helps.


回答1:


Such a handler must be registered in HKCR\Directory\Background, instead of usual locations like HKCR\Directory, HKCR\Folder, etc.

Check out Creating Shell Extension Handlers in MSDN.




回答2:


There's a series of articles on CodeProject that details writing Shell Extensions and is very good:

http://www.codeproject.com/KB/shell/shellextguide1.aspx



来源:https://stackoverflow.com/questions/76553/adding-item-to-the-desktop-context-menu-in-windows

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