[IE tip] Add "Copy Image Location" menu item

As I may have mentioned earlier, I'm making it a point to use IE 7 as my primary browser, at least during the beta test period, so that I can report any issues that I find.

Since I've been using Firefox for such a long time, there was one little thing that was bugging me - IE does not include a context-menu item to quickly copy the location/URL of an image on a webpage. This is something I tend to use quite often (to post links to images in emails, IM messages, on forum threads etc.), and the multi-step process of selecting Properties, highlighting the image location and then copying it just wasn't cutting it.

So I posted a wish/suggestion on the beta newsgroups asking for such a context-menu item. Eric Lawrence from the IE team responded to my post and said it's possible to add something like this quite trivially using the MenuExt registry key. I looked up the MenuExt registry reference on MSDN, understood how it works, and wrote this quick little JavaScript blurb that adds a "Copy Image Location" item to the IE context menu. Note that this is not IE7-specific and will work on IE6 as well.

Here's how you do it. Copy the following piece of code into Notepad and save it as a HTML file to any location (I'll use C:\Windows\copyimageurl.html for this example):

1. Start>Run>regedit
2. Navigate to HKCU\Software\Microsoft\Internet Explorer\MenuExt
3. Create a new sub-key and call it "Copy Image Location" (this is the text that appears in the menu)
4. Set the "(Default)" string value to the location of the html file we created - C:\Windows\copyimageurl.html in this example.
5. In the same key, create a new DWORD value called "Contexts" and give it a value of 2 (this means that the menu item appears only when you right click an image)

That's it. Close any existing browser windows and when you open them back up, you should notice a new context-menu item that copies the image location to the clipboard.

Ok, here you go. Same basic concept.
Toss the code into an html file, create a new sub-key under MenuExt ("Open Link in Firefox"), and set the Default value to the path of the html file. This time you'll want to give the Contexts DWORD a hex value of 20 (that's decimal 32), so that it only appears when you right-click hyperlinks.

You know, this is actually fun to play with! Here are two more I thought of. Very simple, but quite handy - highlight text and search for it on Google or Dictionary.com.
I call the menu items "Google It!" and "Define It!"

You can add Wikipedia, Yahoo, or whatever else you want using the same syntax...even a mapping service to search for street addresses. This time, set the Contexts DWORD value to hex 10 (that's decimal 16) so that the items appear only when you right-click highlighted text.

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt
If you don't see the MenuExt key, just create one. It probably gets created by the first menu extension that's added (mine was the "Export to Microsoft Excel" one created during the Office 2003 install). It's definitely not a Vista-specific feature though.