Hello Mr. Taco,
I believe what you're looking for is "how to extend the shell shortcut
menus" - correct me if I was wrong.
Basically there are two ways to do that:
1. Make a COM component that implements the IContextMenu Interface,
register the component to Windows Shell, and you will have control of
extending the shortcut menus.
2. Modify specific keys in Registry, add your own Command to extend the
shortcut menus.
Now let's take a closer look at these two ways:
The first way is a little bit more complex to implement and debug, however,
you'll have tight control over the customization of the shortcut menus. The
biggest problem is - in your case - it is not a good idea to implement such
a component in VB just like Chris said (thanks to Chris). We can't risk
inject a specific version of CLR into every process that calls dialogs like
GetOpenFileName / GetSaveFileName / SHBrowseForFolder and so on.
So it is clear that we can either choose to use unmanaged languages like
C++ (native) or VB6 to make such a component, or we can choose the second
way.
The basic idea of the second way is to add custom context menu items in the
Registry, Windows Explorer will look for these items before displaying the
shortcut menus, and it will call the command we defined if our item has
been chosen by user.
In this way, you can write a normal Console Application or Windows
Application using VB.NET, and in the Registry settings, point the command
to your application EXE file.
The following article is a good starting point - Extending Shortcut Menus:
http://msdn.microsoft.com/en-us/library/bb776820.aspx
I'd also like to provide you a specific sample, but before that, could you
please let me know more details about how do you want to extend the
shortcut menus?
1. Seems you want your own menu item show up in the Desktop shortcut menu.
2. When you say "the user right-clicks in explorer", do you mean the user
right-click on some specific file / folder or anything or just the white
empty places?
3. What exact action you want to take when your menu item is clicked? Do
you need information like the current folder path that the user was
clicking on? Or any other information?
By understanding the exact requirements, I can then give more specific
suggestions and demos.
Look forward to your reply.
Thanks,
Jie Wang (
[email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.