Customizing Internet Explorer
Windows comes with Internet Explorer 6. IT professionals can customize Internet Explorer in a number of ways using the Internet Explorer Administration Kit (IEAK). For more information about IEAK and to download it see http://www.microsoft.com/windows/ieak/default.mspx. It also comes with the Office 2003 Editions Resource Kit. You can do the following with the kit:
Tailor Internet Explorer and other Internet components to fit the needs of your enterprise or users. For example, you can customize the Links bar and the Favorites menu to promote your intranet or to provide helpful information.
Configure and deploy settings without ever touching desktops.
Customize the setup program so that it requires little or no user interaction.
Control which settings users can change, so that IT professionals can ensure that security, connection, and important settings meet corporate standards.
The following sections describe a few of my favorite customizations for Internet Explorer, including extending its shortcut menus, changing the toolbar's background, and adding search URLs to it.
Extending the Shortcut Menus
Right-click a Web page and Internet Explorer displays a shortcut menu. You can customize this shortcut menu by adding commands to it that you link to scripts in an HTML file. For example, you can add to the shortcut menu a command that opens the current Web page in a new window or highlights the selected text on it.
HKCU\Software\Microsoft\Internet Explorer\MenuExt is where Internet Explorer looks for extensions. Add this key if it doesn't exist, and then add a subkey for each command that you want to add. Finally, set that subkey's default value to the path and name of the HTML file containing the script that carries out the command. For example, to add the command Magnify to the shortcut menu that runs a script in an HTML file C:\Windows\Web\Magnify.htm, add the subkey Magnify, and set its default value to C:\Windows\Web\Magnify.htm. When you choose this command on Internet Explorer's shortcut menu, it executes the script contained in the file. Then you need to create Magnify.htm. The following listing comprises the contents of Magnify.htm. The property external.menuArguments contains the window object in which you executed the command. Because you have access to the window object, you can do almost anything in that window, such as reformatting its contents.
Listing 4-6 Magnify.htm
<HTML> <SCRIPT LANGUAGE="JavaScript" defer> var objWin = external.menuArguments; var objDoc = objWin.document; var objSel = objDoc.selection; var objRange = objSel.createRange(); objRange.execCommand( "FontSize", 0, "+2" ); </SCRIPT> </HTML>
You can also configure the shortcut menus to which Internet Explorer adds your command. In the subkey you created for the extension, add the REG_DWORD value Contexts, and apply to it the bit masks shown in Table 4-5. For example, to limit the previous example so that Internet Explorer displays it only for text selections, add the REG_DWORD value Contexts to Magnify, and set it to 0x10.
Bit Mask | Menu |
0x01 | Default |
0x02 | Image |
0x04 | Control |
0x08 | Table |
0x10 | Text Selection |
0x11 | Anchor |
0x12 | Unknown |
NOTE
If you're interested in learning more about extending Internet Explorer, you should check out Microsoft's documentation for extending the browser, at http://msdn.microsoft.com/workshop/browser/ext/overview/overview.asp. This requires proficiency with writing scripts and HTML, though.
Changing the Toolbar Background
You can customize the background you see on Internet Explorer's toolbar. It's just a bitmap. To change the background, create a REG_SZ value called BackBitmap in HKCU\Software\Microsoft\Internet Explorer\Toolbar. Set this value to the path and name of the bitmap file you want to see in the toolbar's background. Internet Explorer tiles the bitmap horizontally and vertically to fill the toolbar.
Customizing Search URLs
Using search URLs is a convenient way to use different Internet search engines. For example, you might have a search URL called news that searches Google Groups. Type news Jerry Honeycutt in the address bar to automatically search Google Groups for all UseNet articles that contain the words “Jerry” and “Honeycutt.”
You create search URLs in HKCU\Software\Microsoft\Internet Explorer\SearchURL. If you don't see this subkey, create it. Then add a subkey for each search prefix you want to use. To use the example I just gave, create the subkey news. Set the default value of the prefix's subkey to the URL of the search engine. Use %s as a placeholder for the search string. Internet Explorer replaces the %s with any text you type to the right of the prefix. Continue the example, and set it to http://groups.google.com/groups?q=%s&hl=en.
Add the REG_SZ values shown in Table 4-6 to the prefix key you created. These values describe substitutions for special characters in your search string, including a space, percent sign (%), ampersand (&), and plus sign (+). These characters have special meaning when submitting forms to Web sites, so you must substitute a plus sign for a space, for example, or %26 for an ampersand. Thus, the browser translates the string Ben & Jerry to Ben+%26+Jerry.
Deriving the URL that you must use is easy. Open the search engine that you want to add to Internet Explorer's search URLs, and then search for something. When the browser displays the results, copy the URL from the address bar, replacing your search word with a %s. For example, after searching Google Groups for sample, the resulting URL is http://groups.google.com/groups?q=sample&hl=en. Replace the word sample with %s to get http://groups.google.com/groups?q=%s&hl=en.
Name | Data |
<space> | + |
% | %25 |
& | %26 |
+ | %2B |
This hack is so useful that I have a script that automatically creates search URLs for the search engines that I use most often. Copy the following listing to the file Search.inf, right-click it, and then click Install. You can remove this script and all its settings using Add Or Remove Programs. This script creates search URLs for the five search engines that I use most often. The search URL news searches Google Groups; msn searches MSN; ms searches Microsoft's Web site; msdn searches MSDN; and technet searches TechNet.
Listing 4-7 Search.inf
[Version] Signature=$CHICAGO$ [DefaultInstall] AddReg=Reg.Settings AddReg=Reg.Uninstall CopyFiles=Inf.Copy [DefaultUninstall] DelReg=Reg.Settings DelReg=Reg.Uninstall DelFiles=Inf.Copy [Reg.Settings] HKCU,Software\Microsoft\Internet Explorer\SearchURL HKCU,Software\Microsoft\Internet Explorer\SearchURL\news,,0,"%GOOGLE%" HKCU,Software\Microsoft\Internet Explorer\SearchURL\news," ",0,"+" HKCU,Software\Microsoft\Internet Explorer\SearchURL\news,"%",0,"%25" HKCU,Software\Microsoft\Internet Explorer\SearchURL\news,"&",0,"%26" HKCU,Software\Microsoft\Internet Explorer\SearchURL\news,"+",0,"%2B" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msn,,0,"%MSN%" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msn," ",0,"+" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msn,"%",0,"%25" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msn,"&",0,"%26" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msn,"+",0,"%2B" HKCU,Software\Microsoft\Internet Explorer\SearchURL\ms,,0,"%MICROSOFT%" HKCU,Software\Microsoft\Internet Explorer\SearchURL\ms," ",0,"+" HKCU,Software\Microsoft\Internet Explorer\SearchURL\ms,"%",0,"%25" HKCU,Software\Microsoft\Internet Explorer\SearchURL\ms,"&",0,"%26" HKCU,Software\Microsoft\Internet Explorer\SearchURL\ms,"+",0,"%2B" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msdn,,0,"%MSDN%" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msdn," ",0,"+" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msdn,"%",0,"%25" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msdn,"&",0,"%26" HKCU,Software\Microsoft\Internet Explorer\SearchURL\msdn,"+",0,"%2B" HKCU,Software\Microsoft\Internet Explorer\SearchURL\technet,,0,"%TECHNET%" HKCU,Software\Microsoft\Internet Explorer\SearchURL\technet," ",0,"+" HKCU,Software\Microsoft\Internet Explorer\SearchURL\technet,"%",0,"%25" HKCU,Software\Microsoft\Internet Explorer\SearchURL\technet,"&",0,"%26" HKCU,Software\Microsoft\Internet Explorer\SearchURL\technet,"+",0,"%2B" [Reg.Uninstall] HKCU,Software\Microsoft\Windows\CurrentVersion\Uninstall\%NAME% HKCU,Software\Microsoft\Windows\CurrentVersion\Uninstall\%NAME%,DisplayName\ ,,"%NAME%" HKCU,Software\Microsoft\Windows\CurrentVersion\Uninstall\%NAME%,UninstallString\ ,,"Rundll32.exe setupapi.dll,InstallHinfSection DefaultUninstall 132 "\ "%53%\Application Data\Custom\Search.inf" [Inf.Copy] Search.inf [DestinationDirs] Inf.Copy=53,Application Data\Custom [SourceDisksNames] 55=%DISKNAME% [SourceDisksFiles] Search.inf=55 [Strings] NAME = "Jerry's IE Search URLs" DISKNAME = "Setup Files" ; Search URLs GOOGLE="http://groups.google.com/groups?q=%s&hl=en" MSN="http://search.msn.com/pass/results.aspx?q=%s" MICROSOFT="http://search.microsoft.com/search/results.aspx?qu=%s" MSDN="http://search.microsoft.com/search/results.aspx?qu=%s&View=msdn" TECHNET="http://search.microsoft.com/search/results.aspx?View=en-us&qu=%s"
Maximum Concurrent Downloads
By default, Internet Explorer allows you to download two files from a server at a time. If you're downloading numerous files, you have to wait for one of the files to finish downloading before you can start another. However, you can easily increase the number of files that Internet Explorer can download concurrently. Set the REG_DWORD values MaxConnectionsPer1_0Server and MaxConnectionsPerServer (create them if necessary) in the key HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings to the maximum number of files that you want to download concurrently.