Using A Resource Editor to
Edit Netscape Version 1.2 Menu Choices
Get A Resource Editor Tool
- Resource Workshop 4.5 - available from Borland (800-523-7070)- $69
- Borland's Resource Workshop is also available as part of theBorland C++ and Turbo C compiler packages.
- Microsoft's Resource Editor is available as part of theirVisual C compiler package.
- Symantec has a resource editor as part of their compiler package.
- There are probably other third-party options available aswell.
Since we are using Borland's Resource Workshop for ourediting, the following examples are based on it. The other resourceediting tools will follow similar steps, although the details(menu names, etc.) may differ.
- Install - you'll get a ProgramGroup (illus) with several Icons - Openthe "Resource Workshop Reference" icon - Then "Essentials"- Then "Getting Started" - Then "Projects Overview"- Then "Opening an existing project" - READ THIS (ofcourse, you should read the entire help section, but this oneis the most pertinent for the following.)
- Make a copy of your netscape.exe file (Weput our copy in another directory we created called Test - sowe didn't confuse it with our unaltered netscape.exe.)
This is VERY important. A resource editor is a powerful tool andyou can easily modify a program to the point where it no longerworks. Do not modify your only copy of a program. Always makea copy before using a resource editor to modify a program.
- Open Resource Workshop
- Under File menu choose "Open Project"- use the dialog box (illus)to find your test copy of netscape.exe. In this case the "project"you will be working on is the executable program itself.
- When you open it - Resource Workshop decompilesit and you get a little window with "netscape.exe" atthe top and a section at the left with "BITMAP" at thetop and a list of numbers (illus). Maximizethe window - scroll down until you get to "MENU"
- Double click on the "2" and theediting dialog box for MENU 2 opens (illus).Pay attention here, if you single-click, youget a different window (illus).To editthe Open File menu item (this is the one that allows people toscan and open files on the hard drive of the computer) - clickon the "MENUITEM - Open File" choicein the lower right side of the window to highlight it. The dialogbox changes to it and the options you have are listed.
- In the middle of the window on the left you'll see a sectionnamed "Initial State" - with the "Enabled"checkbox marked.Click on the "Grayed" checkboxto change the mark to it. (illus)When the edited Netscape is run, the user will see the OpenFilemenu item grayed out and will be unable to select it from themenu.
- That's it - you can examine the test menuon the right of the screen to see the effects of your newly-grayedmenu item (illus).
Now do the same thing with "MENUITEM - &MailDocument." This will prevent user access to themail system from the menu.
- Scroll down the lower right window to "MENUITEM- Preferences" - Click on it - "Gray"it out - do the same thing with "MENUITEM - SaveOptions"- "Gray" it out. These will prevent the userfrom making changes to the default preferences and preserve programand system integrity from user to user.
- Close the menu window by double-clicking on the closebutton in the upper left corner of the menu window, NOTthe close button for the Resource Workshop mainwindow (illus). If you accidentally closeResource Workshop, you will need to restart it.
- We also removed the ability to "Configurea Viewer" from the Unknown File Type Dialog Box. To do this- scroll down the list on the left of the window to "DIALOG"#142. Double-click on 142 - Double-click on the "Configurea Viewer" button to select it. (illus)In the middle of the window on the left you'll see the "Attributes"section. Click on the "Disabled"checkbox so that it is checked (illus).Then click the OK button. The button text will now begrayed and users will no longer be able to press the button.
- Close the resource window by double-clicking on theclose button in the upper left corner of the resource window,NOT the close button for the Resource Workshop main window.If you accidentally close Resource Workshop, you will need torestart it.
- Now edit "DIALOG" #141 (the Send Mail/PostNews dialog). Select the "Send" button and disable it.This will prevent the user from accessing the mail system fromwithin the usenet groups section of Netscape.
- You're finished! Go to File Menu and choose "SaveProject"
- It will save the changes. Now go to File Menu andchoose Exit. Your edited copy will most likely not bethe same size as the original. This is normal.
To test your work. Go into the test directoryyou've saved the edited netscape.exe in and rename it to nstest.exe,move it into the directory you have the unedited netscape.exein and double-click on the nstest.exe to open it (this assumesyou have a connection open to the Internet or that opening netscapecalls the winsock.dll. If not, you may have to launch your winsockstack first.)
Once you're ready to use this version, you can renameit to netscape.exe and it will launch when you clickon the Netscape Icon in your program group. (If you don't wantto overwrite your original version of netscape.exe - be sure torename it or move it to another directory first.)
FAQ (Frequently Askd Questions)
- Q. What is a resource? Why do I need to editone?
A. Simply put, a resource is a part of a program.Resources may be pictures, text, program code, dialog boxes, buttons,icons, cursors, or other things. You can define your own resourcetypes and include them in programs. Programmers use resourcesto store information that a program may need in an easily retrievableform. In our case, the program menus and dialog boxes in Netscapeare stored in resources. Using a resource editor, we can changethe appearance or the function of program resources. We can usethis ability to disable certain functions to prevent accidentalor malicious actions by users of publicly-available terminals.
- Q. Is one resource editor better than another?
A Probably not. Use what you can get. We useBorland's Resource Workshop because we could buy it as a stand-aloneproduct, without having the overhead of having to purchase anentire development package for the library.
- Q. Why can't I choose "Disabled"rather than "Grayed" for menu items?
A. You can. It will function exactly the sameway. Users will no longer be able to select the menu items youhave disabled. However, graying unusable menu items is a standardway of providing feedback to the user that certain choices areunavailable. As an example, see the "Paste" menu itemin the "Edit" menu. It only becomes ungrayed when thereis information available to paste.
- Q. How about doing other things?
A. We have decided to let users view and editthe bookmark file. If this is not desired, you can disable thisfunction by graying out the View&Bookmarks menu item. If youare using Trumpet Winsock as your internet transport, you maywish to perform similar surgery on TCPMAN.EXE to disable someof the functions. In particular, we have had to disable the debuggingtrace functions. When they are accidentally enabled any networkaccesses are significantly slowed down due to the logging processand the user is usually unaware of the cause of the sudden sluggishnessof Netscape.
- Q. Are there any drawbacks to editing theresources?
A. Keep in mind that you are editing an executableprogram file. Each time you upgrade your computer to a new versionof the software you must edit the resources in the new version.It is possible, but unlikely, that resource IDs may change betweenprogram versions. Thus you may find that DIALOG #143 in Netscapex.4 has changed to become DIALOG #256 in Netscape x.5. The sameprocedures will apply, but you will need to be aware of this whenediting the new version.
- Q. Can there be other side-effects of editingresources?
A. Of course. In theory, no, there can't. Simplymaking menu items unavailable to the Windows system should haveno consequences on the function of a program. The same is truefor disabling or even deleting buttons. However, poorly writtenWindows programs may expect that certain resources be availableto them and may act in unexpected ways if you do too much muckingaround. The changes we have made to Netscape are minimal and wehave taken care not to change the numbering of resources nor todelete any resources from the program. The changes should notaffect the functioning of the program in any way.