|
||
| Inside Technique : Introduction : The Registry Information You can divide a context menu addition into two parts. The first part is the scripting code the menu entry will trigger. The second is the registry entry that tells Internet Explorer your menu addition exists. The registry half is easier, so let's begin with that. Internet Explorer keeps the context menu additions under the registry key "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt". You can find it in Window's Registry Editor (Open up "Start/Run...", type "regedit", and click "OK"). It will take a bit of clicking to find the key, however. Another way is to create a registry file, which is a text file that stores registry data. The file method can be easier (right-click on it and the data is automatically added), but one typo could muck up the registry. This tutorial assumes you'll use the file method. Registry files are just ASCII text files, but with a different file
extension (".REG", not ".TXT"). You will have to
use Notepad, or another ASCII-text editor, to create them. A sample one is
shown below:
Let's go over the proper format line by line.
This just says that this text file really is a registry file, not a normal text file that was renamed by accident. [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Resize to &640x480] You should recognize most of this line from the previously mentioned registry key. The subkey below it, "\Resize to &640x480", serves as the name of the context menu entry and also holds all the configuration data. The ampersand before the "6" tells Windows to make that character a shortcut. In this case, bringing up the context menu and typing "6" will automatically start "Resize to 640x480". Now we start looking at the registry subkey's data. All of the data, no
matter what the type, follows the same general format. The name of the
data comes first, then an equal sign, then the data value.
This line in the ".REG" file is a little special. The "@" symbol is a sign that the text is the registry subkey's "default" value. For context menus, the default value is the location of the script to execute, in this case "c:\windows\web\640window.html". Registry files have a restriction on file names, however. All directory backslashes have to be doubled-up (in other words, type "\\" instead of "\"). If you are adding values with Window's Registry Editor, you lose that restriction but gain another: no filename can have a space in it. Substitute the script's MS-DOS file name, if that is a problem. Next, we'll cover how to select a specific context menu. Page 1:Introduction © 1997-2000 InsideDHTML.com, LLC. All rights reserved. |