Hacking the Context Menu

fazaal24

Member
Nov 10, 2006
33,026
18
0
Carbon Canyon Dehiwala
What is the context menu? This is the menu that pops up when you right-click a file on your
computer. Over the years, these menus have become more and more useful.

However, with the extra entries in the context menu, they often become cluttered with options and features that
you just don’t need. These next few sections will show you how to get your menus back under control as well as how to take advantage of the new features to make your own context menu entries.
We will start off by removing items from the context menus and will then move on to adding and customizing the components of the menus.

Removing items from the context menu Over time, your context menus can become cluttered with program entries from old programs that you may not use any more. Sometimes, you may experience programs that take over all of your context menus. Compression apps such as Winzip or Picozip always end up adding program entries to all of the context menus. I have Picozip installed on

My Computer and everytime I right-click any file or folder, I see five entries from Picozip giving me different compression options. This can be a convenient feature, but if you don’t compress and extract ZIP files very often, then you might not need the added convenience. Instead you could remove these
entries from your context menu, which will give your system a cleaner interface as well as a small performance boost if you have a lot of extra entries in your context menu.

Before editing your registry, you would be wise to create a system restore point by using system restore. Doing so will provide an easy method to revert to your original configuration before you made any changes just in case you accidentally delete or modify something that hurts your computer.

Actually removing these programs from your context menus can be a little tricky, because they are spread in different places in the registry. Also, the easy-to-use context menu editor that you used in the last section to change the icon and default launch app for certain file types is not robust enough to allow you to remove entries from programs that take over all context menus such as Picozip. The only way to remove these types of entries is to edit the registry directly. If you want to remove an entry on a context menu that does not appear on every context menu and just appears on one or a few other file types, then you can still use the easy-to-use editor.

Because of that, I have provided you two different sets of steps depending on what you want to do.When you are ready, follow these steps for the corresponding type of entry to remove it for good.

Removing entries that appear in all context menus

This set of steps will show you how to remove entries in the context menu that appear in all menus for all file types that were put there by programs such as Picozip.


1. Start up the Registry Editor by clicking the Start button and selecting Run. Then type
regedit in the box and click OK.
2. When the Registry Editor appears, expand the HKEY_CLASSES_ROOT folder. You will now see a list of every file type that is set up on your computer.
3. If the entry that you want to remove from the context menu appears in all context menus, such as the preceding Picozip example, you will have to expand the * folder.

4. Now that you have the correct folder expanded, expand the Shellex and ContextMenuHandlers folders. Your registry path should look like HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers.
5. Look through the list until you find the entry that you want to remove. Right-click the folder of the entry and select Delete. You will find that identifying some of the programs is easy. For example, Picozip is labeled Picozip. However, you may run into some items that are listed using their application ID number or a vague name. If that is the case, copy (CtrlC) the application ID, which is formatted like this—{XXXXXXXX-XXXXXXXX-XXXX-XXXXXXXXXXXX}—to the clipboard. You may have to expand the folder to see the ID. Then, once you have the ID copied to the clipboard, press CtrlF to bring up the Search box in regedit and paste the ID in the box. Next, just click Find and you should be able to find some other references to that same ID in your registry
that also might give you some clues to what it is. If that does not work, try doing a search on Google to see if that turns up anything.
6. Once you are finished removing all of the entries from your context menus, just close Registry Editor and you are finished. Your changes will be in effect immediately.

Adding your own items to the context menu

Now that you have removed all of the extra clutter from your context menus, why not add some useful entries to your menus? You can add a lot of interesting things to your context menus that can enhance your experience with your computer. My favorite item to add to the context menus is a “Send Attached to Message” entry. This entry in my context menu grew
out of a need to find a better way to e-mail files. I send a lot of messages every day, often just for the purpose of sending a file. I thought to myself, wouldn’t it be simple if I could just right-click a file and select some option that would automatically open up Microsoft Outlook, create a new message, and attach the file? That would streamline the whole process by knocking out a few steps.
Adding an entry to a context menu is very simple. The most difficult part of solving my little puzzle was figuring out how to launch Outlook so it would automatically create a message and attach the desired file to it. After a few minutes on Google researching, I came across Outlook-Tips.net, which is a great resource for just the information that I was looking for. According to
www.outlook-tips.net/howto/commandlines.htm, I just had to launch Outlook
with the /a switch and the name of the file. Once I had this information, I had all of the pieces of the puzzle and was ready to start putting it together. Perform the following steps to learn how to add your own item to any File Types context menu:

1. First, open up a copy of My Computer by clicking the icon on the desktop or Start
panel.
2. Click the Tools menu bar item and select Folder Options.
3. Then, click the File Types tab to expose all of the different file types on your computer.
4. Because I usually send Word documents, I scrolled down the list of file types and selected the .doc file extension. Pick any other file extension for which you would like to add an entry.
5. Then, once you have the entry selected, click the Advanced button to bring up the Edit File type window.
6. Click the New button to add an entry.
7. In the Action box, type in the name that you want to appear on the menu. I typed in Send Attached to Message.
8. Then, in the Application Used to Perform Action box, you will want to specify the application and any switches that you want to use for this new entry. Click the Browse button to easily browse to an executable. I navigated until I found OUTLOOK.EXE inside the OFFICE11 folder.
9. When you click OK, the path to the executable will fill the box. Now you will want to add any application flags at the end of the line.To tell Outlook to create a new message and attach a file to it, I had to add /a- after the path, followed by %L. The %L is a system variable that holds the name of the file that you are right-clicking.When I was finished, my box looked like the following (including the quotes): “C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE” /a “%L”.
10. When you are finished editing your new entry, click OK to save it.
You are now finished adding an entry to a specific File Types context menu. If you followed all of the previous steps to add the Send Attached to Message entry, every time you right-click a Word document, you will now see the new entry.