Does anybody know how I can associate a menu-item with my program when the user for example right clicks on their desktop? Or for example, let's say the user selects a series of files and/or folders and right clicks. How can I create a menu-item in the list of the items that will popup in the default menu?
Thanks in advance
Thanks in advance
I'm having problems with my website provider this weekend but I have attached an example here...
Hi Edgar-
That works if you click on a file, do you have anything that works if you right click on the naked desktop?
That works if you click on a file, do you have anything that works if you right click on the naked desktop?
JimG, in DllRegisterServer function, add your CLSID to \SOFTWARE\Classes\Directory\Background\shellex\ContextMenuHandlers.
Thanks sapero, I'll give it a try.
Okay here's the deal! The context menu handler can handle specific file types. Right? But let's say the user selects a bunch of files with different extensions and a couple of folders and then right clicks. How can I handle that? I have looked in many places but all of the codes just deal with specific file types. For example, UltraEdit (Hex Editor) appears in the Explorer's context menu wherever you right click on any file or a group of files/folders. That's what I have to create and have no idea how to by the way.
Hi XCHG,
Multiple files are handled through IContextMenu::InvokeCommand, you can use DragQueryFiles to extract the information for more than one file, in my example I do not loop the query but it is not difficult to add the couple of extra lines needed.
Multiple files are handled through IContextMenu::InvokeCommand, you can use DragQueryFiles to extract the information for more than one file, in my example I do not loop the query but it is not difficult to add the couple of extra lines needed.
Are you talking about multiple files of the same type? I am not if you are :(
Hi XCHG,
You can specify any file type by using the "HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers" file class when registering the menu handler, then all files will be passed to it.
http://msdn2.microsoft.com/en-us/library/bb776881(VS.85).aspx
You can specify any file type by using the "HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers" file class when registering the menu handler, then all files will be passed to it.
http://msdn2.microsoft.com/en-us/library/bb776881(VS.85).aspx
Hits the nail on the head! Thanks.
Hits the nail on the head! Thanks.
No probs. Good luck with the project.
Hits the nail on the head! Thanks.
No probs. Good luck with the project.
Thank you so much. I did finish the project. It was a code that I had to write for somebody in RentaCoder.com and I did it in Delphi which helps a lot for such projects. However, I have to mention that to register the Shell Extension to work with both files and folders, I had to write the Registry entries for both HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers and HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers. Before that, when a list of files and folders was selected, you couldn't see the Shell context menu item. But after registering the context menu handler for both * and Directory, it worked fine.
Thank you again for your help. Your example helped a lot.