I logged in to Gmail just now and saw a new feature on the Settings page.
New! Get the Google Toolbar, now with Gmail search, and search your mail quicker than ever.
The installer download on that page – named GmailToolbarInstaller.exe – simply added a Gmail button to my Google Toolbar that allows me to search Gmail (or takes me to my Gmail inbox if I don’t enter any search terms).
I figured that since the install was only 15 KB, it must have been a pretty simple upgrade. On the surface, the only changes were that a Gmail icon was now in the toolbar and in the "Search the Web" drop down next to the search box. Also, the "Search" tab of the Google Toolbar "Options" window had a new section called "Add Custom Search Buttons to your Toolbar" that listed the Gmail icon with a checkbox next to it. Hunting around in Registry Editor, I found this new key:
HKEY_CURRENT_USER\Software\Google\CustomSearch\Gmail
The term "CustomSearch" was intriguing, so I decided to try and add my own custom searches. What I found was that you can add you own custom search buttons to the Google Toolbar by making a few simple changes to your registry...
Caution: Editing your registry incorrectly can cause irreparable system damage. Fiddle with it at your own risk!
Here’s an example of an exported registry key that adds a Yahoo! Search button:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Google\CustomSearch\Yahoo]
"Site"="http://search.yahoo.com/"
"Tip"="Yahoo! Search"
"Title"="Yahoo! Search"
"Url"="http://search.yahoo.com/search?p={query}"
Icon (not shown here) contains a hex encoded icon that will be used for the button in the toolbarSite contains the URL that you will be taken to if no search terms are enteredTip contains the text that appears in the tooltip when you hover your mouse over the buttonTitle contains the name of the button used in the "Search the Web" drop down and the "Add Custom Search Buttons to your Toolbar" listUrl contains the URL, complete with the query string, for the search you wish to performLikewise, here’s one that will add an MSN Search button:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Google\CustomSearch\MSN]
"Url"="http://search.msn.com/results.aspx?q={query}"
"Site"="http://search.msn.com/"
"Tip"="MSN Search"
"Title"="MSN Search"
Basically, you can add a button for any site that uses a query string! For example, here’s one that will query Alexa for a website’s details when you enter a domain:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Google\CustomSearch\Alexa]
"Site"="http://www.alexa.com/"
"Tip"="Alexa"
"Title"="Alexa"
"Url"="http://www.alexa.com/data/details/?url={query}"
These buttons then appear in the drop down list of search buttons next to the search box:

... or you can add them to your toolbar from the "Search" tab of the Google Toolbar "Options" window:

Here are some sample registry files that automatically install the search buttons:
Simply right-click the links, download the files (selecting Save Target As...), change the extension to ".reg" and just double-click to install the custom search buttons. [Insert usual disclaimer about me not being held responsible for your actions here.]
At last – I only need to have one toolbar installed that will handle all my search needs!
Update: 16 September 2005
I’ve just discovered that these instructions work for both Internet Explorer and Firefox, although I don’t know where Firefox stores which custom search buttons it should display in the toolbar...
Update: 6 November 2005
Several people have asked me how to create hex encoded icons for use in these files, so here’s how it’s done:
Labels: google

My name is Tony Ruscoe. I have worked at Google since January 2010.
I can also be found and followed here:
This is my personal website. The views expressed on these pages are mine alone and not those of my employer.