Title |
How to add a new option to
the context menu for a file type |
Description |
Options in the context menu
that appears when you right click on a file are user definable and very
easy to set up |
Date |
08/30/2000 |
Last revision |
|
Almost everything in Windows 9x is user definable. From the colors of the desktop
to the program selected to open and modify certain type of document, there is
a lot of information stored in the registry. Many of these options can only
be modified directly with the "Registry Editor". Fortunately, the options needed
to redefine the context menu have their own interface included in the basic
interface of Windows. As an example to show the steps needed to redefine this
menu, we are going to create a new option to edit HTML files with notepad.
Finding out the name of the file
type
The first thing we need is finding out the name of the file type we are going to modify. Normally we will know the extension of the document, but the name itself could be different depending on the programs we have installed. In our case, the name for the html documents may be different depending on the browser we have installed in our system. To find out the name of the file type we only have to locate one file with the type we want to modify, right click on it and select properties in the context menu. A system window will appear displaying some properties of the file, including the name of the file type at the top of the window. For instance, html files in my system appear as "Microsoft HTML Document 5.0".
Locating the file
type definition
Once we know the name of the file type, we can look for its definition using the standard windows interface. Double click on "My computer" to open it, select "Options" in the "View" menu and click on the last tab labeled as "File types". You will see a list containing all the file types registered in the system configuration sorted by file type name, in that list you can look for the name of the file type we found out before. In our example, we have to look for the document type labeled as "Microsoft HTML Document 5.0". Once we have selected the proper file type definition, we can use one of the buttons at the right of the window to modify it. We can add a new file type definition, we can remove the selected file type definition or we can edit the selected file type definition. Press on the third button to modify the file type definition of the "Microsoft HTML Document 5.0" files.
Adding the new action
In the window we got with the specification of the file type definition, we
have a list of all the defined actions for the file type, with the default action
displayed with bold letters. You have buttons to create new actions, edit an
action, delete it or select it as the default action. To create a new action,
click on the "New" button. You will be prompted for the name of the action and
the application needed to perform the action. The name of the action will be
displayed in the context menu when you right click on a document of the file
type. To complete the example, we only have to type "Edit with Notepad" in the
action name edit box, and "notepad.exe" in the application edit box. Afterwards,
click on "Ok" to close each window, look for a HTML file and right click on
it to display its context menu. You will see the fresh new option being part
of the list, select this new option and the Windows notepad will be open and
your HTML file will be loaded.