Posted on Thursday, August 12, 2004 5:26 PM
I've often thought that Internet Explorer should include buttons to move to the Top or Bottom of a browsed page. It seems so logical. It is possible to move to either end of a document using the context-menu on the scroll bar but I decided to add my own buttons. The scripts and icons required are in the project files zip.
The scripts:
Firstly you you need to create two html pages with the scripts to perform the moves (Top and Bottom):
File: top.htm
Content:
< script language="JavaScript">
var parentwin = external.menuArguments;
parentwin.scroll (0,0);
< /script>
< /html>
File: bottom.htm
Content:
< script language="JavaScript">
var parentwin = external.menuArguments;
var height = parentwin.document.body.scrollHeight;
parentwin.scroll (0,height);
< /script>
< /html>
The Icons:
You also need some Icons for the buttons. I have attached four icons in the project files - these were designed to be used on Windows XP where the Hot Icons are the same as the standard Icons. Other versions of Windows use a greyscale icon until the mouse enters the button.
Icon file format and requirements:
16 x 16 icon 16 colours *
16 x 16 icon 256 colours
20 x 20 icon 16 colours
20 x 20 icon 256 colours *
(* Required icon formats - the other two are optional)
The Registry:
You should ALWAYS make a back-up of the Registry before editing it and only do so if you understand how the Registry works.
You need to create 2 GUIDs - Visual Studio .NET has a "Create GUID" in the Tools menu. You need to add two keys to the Registry using the GUIDs and also add the relevant information for each Button.
Adding the Keys:
This example adds the keys for all users through HKEY_LOCAL_MACHINE. If you only want to add the buttons for the current user, change HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER
Top Button
Edit Registry - navigate to:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions
Add Registry Key:
{ACA14E6C-27C2-409b-A644-ECB38A62E656}
Add the following String Values to the Key:
| Value Name |
Value Data |
| ButtonText |
Top |
| Icon |
{path of file}\mTop.ico* |
| HotIcon |
{path of file}\hTop.ico* |
| Default Visible |
True |
| CLSID |
{1FBA04EE-3024-11D2-8F1F-0000F87ABD16} |
| Script |
{path of file}\top.htm* |
* Change {path of file} to the exact path where the icons and scripts are held. If you use different file names you will also need to change these.
Bottom Button:
Edit Registry - Navigate to:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions
Add Registry Key:
{D5CB7AD4-9470-41a8-BF50-1F239C428FCC}
Add the following String Values to the Key:
| Value Name |
Value Data |
| ButtonText |
Bottom |
| Icon |
{path of file}\mBottom.ico* |
| HotIcon |
{path of file}\hBottom.ico* |
| Default Visible |
True |
| CLSID |
{1FBA04EE-3024-11D2-8F1F-0000F87ABD16} |
| Script |
{path of file}\bottom.htm* |
Change {path of file} to the exact path where the icons and scripts are held. If you use different file names you will also need to change these.
If you have customized your browser toolbar, the buttons will not appear by default. You will need to add the buttons in from the Customize Toolbar option.
Resources:
Microsoft - Adding Toolbar Buttons, Toolbar Button Style Guide