Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

The Code Project Search Bar

0.00/5 (No votes)
16 Jul 2005 1  
The Code Project SearchBar gives you quick access to the Code Project site, and lets you do searches at any time, from any web page.

Introduction

The Code Project SearchBar gives you quick access to the Code Project site, and lets you do searches at any time, from any web page. The SearchBar is a plugin that adds a toolbar to Internet Explorer 5 or later. The toolbar has a text box and buttons that give you instant access to Code Project features. Here's what the toolbar looks like, and what the controls do:

 [Toolbar description - 17K]

SearchBar revision history

System Requirements

Windows 95, 98, Millennium, NT 4, 2000, XP, or Server 2003 with Internet Explorer 5 or later. I have not personally tested on Server 2003 but as long as you enable IE plugins, the SearchBar should run fine.

Quick Searching

The Code Project's search engine can search in four ways, and you can do them all from the SearchBar: article contents, article titles, article summaries, and authors' names. To search within article contents, enter the text you want to find in the search box, and click the Search button (or press the Enter key). The search results will appear in the browser window. To do any of the other three searches, click the down arrow on the Search button, then pick a search type from the menu, as shown here. You can also do a search within authors' names by pressing Ctrl+Enter.

 [Search submenu - 18K]

The SearchBar also supports drag and drop searching. If you see something (for example, a program name, COM interface name, etc.) on a web page and want to use it in a Code Project keyword search, you can highlight the text and drop it on the SearchBar. For example, suppose you're reading this MSDN page on shell extensions:

 [Selecting text - 32K]

If you want to search for "shell extension handlers" in Code Project articles, first select the text as illustrated above. Then drag the text onto the SearchBar. The mouse cursor will change to show that the SearchBar is ready to accept the text:

 [Dropping text on the toolbar - 33K]

When you release the mouse button, the SearchBar will perform a search within article contents for the selected text. You can also drag text from any other program that supports dragging and dropping of plain text, such as Word or Visual Studio.

New in version 1.2: The SearchBar also adds search capability to the context menu displayed when you select text in the browser and right-click it. The new menu items, shown below, are Code Project Keyword Search and Code Project Author Search. This feature is particularly useful if you use an IE-based browser (like Maxthon) that doesn't support IE toolbar extensions.

 [IE context menu items - 4K]

Code Project Site Links

Click the CodeProject button in the toolbar to go right to The Code Project home page. You can also click the Site Links button to see a menu of shortcuts to various areas of the site. The My Code Project Account submenu contains links to several pages for managing your account. (Note that you must enable automatic login in your Code Project account settings for these links to work.) The other link descriptions should be self-explanatory.

 [Site links menu - 8K]

Beginning with version 2.0, the Site Links menu is built from an XML file, so the menu can be customized. The XML file is called searchbar.xml and is stored in \Documents and Settings\All Users\Application Data\The Code Project\SearchBar on Win 2000 and XP, or \windows\All Users\Application Data\The Code Project\SearchBar on other OSes. You may change this however you like (the expected XML should be obvious if you inspect the contents) if you want to add or remove links from your own menu.

CodeProject administrators will occasionally update the available site links and post a new searchbar.xml on the site. When you run Internet Explorer with the SearchBar activated, the SearchBar will check CodeProject to see if an updated XML file is available. If so, it is downloaded in the background and automatically installed. This check is done only once per week, so it won't eat up a lot of bandwidth (either yours or the site's). You can also manually download updates to the Site Links menu using the Update Site Links Menu command, explained below.

Using the Code Project Web Service

The first item on the Site Links menu, Code Project Web Service, has three commands that interface with the web service.

 [Web svc commands - 6K]

Each of the three items contacts the web service and shows the corresponding list of articles or messages in the browser. For example, clicking Latest Lounge Topics shows a list like this:

 [Listing from web svc - 12K]

Each topic has a link directly to the Lounge post, as well as the CP-standard [^] link for opening the post in a new browser window. If your system is not connected to the Internet (as in the screen shot above), the SearchBar will show the topics list from the last time you were online. All dates and times are shown in your local time.

The SearchBar Control Menu

Click the down arrow next to the CodeProject button to see the SearchBar's control menu:

 [Control menu - 5K]

You can check CodeProject for an updated Site Links file by clicking the Update Site Links Menu item. If a new file is available, it will be downloaded and the Site Links menu will reflect the update immediately. This will also notify you if a new version of the SearchBar is available.

Click the About item to see the SearchBar about box, which shows the program's version number.

SearchBar Options

Click SearchBar Options to open the SearchBar options dialog. There are two pages, General and Signatures.

The General page

 [General options page - 52K]

The first check box controls whether text is shown on the toolbar buttons. You can turn off the button text so the SearchBar will take up less screen real estate, as shown below:

 [Toolbar without button text - 11K]

The combo box controls how searches are done. The default is to search for articles containing any of the search words. So for example, searching for "color button" finds articles containing either word. Selecting Search for all of the words makes your searches only return hits containing all the search words. The Code Project search engine now supports exact phrase searching; see the main search page for more details.

The next section is your enemies list - people whose posts you don't want to see when viewing the web service data.

New in version 3.0: Finally, there are two options that control new posting page enhancements. These two check boxes correspond to the two options on the posting page. When you start a new post, the SearchBar will check or uncheck the posting page options to match what you set here on the General page.

All settings are stored on a per-user basis.

The Signatures page

 [Signatures options page - 50K]

Version 3.0 introduces a signature manager, which lets you keep a set of signatures that can be inserted into your posts. When you are writing a post, you can use the new signature commands on the Commands menu (see below) to insert one of your signatures (either a specific one, or one chosen at random). You can also use the keyboard shortcut Ctrl+Shift+R to insert a random signature. If you check the Insert a random signature into new posts check box, the SearchBar will automatically insert a signature when you begin a new post.

The Where to insert signatures combo box determines how the signature is merged with your existing CodeProject signature that you set in your account options. The way I use it is to set it to Append to CP signature, that way my CodeProject signature is constant (it contains my name and some links) then the SearchBar appends one of my witty quotes. You can also set the SearchBar to prepend to the CodeProject signature, or replace it entirely.

If you already use one of the existing CodeProject signature managers (Desktop Bob, AutoSig, or Code Project Quoter), you can import those signatures into the SearchBar by clicking the Import button, then browsing to the XML data file used by the other signature manager. The SearchBar keeps your signature list in \Documents and Settings\[username]\Application Data\The Code Project\SearchBar on Win 2000 and XP, or \windows\Application Data\The Code Project\SearchBar on other OSes.

Posting Page Enhancements

The SearchBar now adds several features to the message posting page that make it easier to add emoticons, insert hyperlinks, and post C++ code. When you are on a posting page, you can bring up the emoticon menu by pressing Ctrl+Shift+Space:

 [Emoticon menu - 17K]

Select an emoticon to insert it in the message edit area. The Commands submenu contains other enhancements, and lists their keyboard shortcuts. For example, to convert the selected text to a hyperlink, you can press Ctrl+Shift+L.

The available enhancements are:

  • New in version 3.0: Insert any of your signatures from the list on the Signatures options page.
  • New in version 3.0: Insert a random signature from that list.
  • Insert the HTML for < > and & so C++ code doesn't get treated like HTML tags.
  • Convert < > and & characters in the selected text to their HTML equivalents (handy for times when you copy C++ code from somewhere else).
  • Add or remove <code> tags around the selected text (same as clicking the code button in the editing toolbar).
  • Convert the selected text to a hyperlink (with or without the [^] new window link).
  • Preview the post.
  • Submit the post.

Installing and Activating the SearchBar

Download the SearchBar self-extracting executable from the link at the top of this page. If you are installing over an existing copy of the SearchBar, close all Internet Explorer windows before running the EXE. If you don't do this, the SearchBar DLL will be in use and the installer won't be able to replace it with the new copy. If you are installing over version 1.1 or later of the SearchBar, the installer will detect when the DLL is in use and alert you.

Run the EXE, select the directory where you want the files installed, and click Install.

 [Install dialog - 14K]

If you use an anti-spyware program with real-time protection features, you may receive two alerts - one for the toolbar and one for a browser helper object (BHO). Be sure to allow both to be installed for the SearchBar to work properly.

The next time you run Internet Explorer, the SearchBar will be automatically enabled and will appear in the bottom row of toolbars. If it doesn't appear, click the View menu and point to Toolbars. There will be a new item that reads The Code Project SearchBar. Click this item to display the SearchBar. Repeat those steps to hide the SearchBar. Alternatively, you can right-click any existing Internet Explorer toolbar to get a popup menu that lists the available toolbars, and click The Code Project SearchBar in that menu.

If these steps still do not make the SearchBar visible, IE may be set to now allow third-party plugins. To check this option, go to your IE options, Advanced tab, Enable third-party browser extensions check box. Spyware may also interfere with IE plugins, so do a spyware scan if in doubt (using a reputable scanner like Ad-Aware, Spybot Search&Destroy, or Microsoft AntiSpyware).

 [Toolbars menu - 13K]

If you are running IE 5.0, there will be multiple Radio items on the menu. That is due to an IE bug - it lists all toolbar extensions as Radio. The last Radio item should activate the SearchBar.

Note that, depending on your Internet Explorer settings, you may have to log off and back on for Internet Explorer to begin using the newly-installed SearchBar.

Uninstalling the SearchBar

You can uninstall the SearchBar using the Add/Remove Programs Control Panel applet. The SearchBar has a really simple uninstaller at this time, which only unregisters the SearchBar DLL and the web service reader. You will need to delete the files manually. (This will be fixed in a future update.)

Acknowledgements

The SearchBar was built with Erik Thompson's DeskBand ATL Object Wizard. Thanks also to Erik for helping me fix bugs over MSN Messenger at 2 AM!

Revision History

  • v3.0 (July 17, 2005) - Added new signature management features. Added a BHO to automatically show the toolbar the first time IE is run after installing the SearchBar. Added three new smileys.
  • v2.0.2 (September 14, 2003) - Added new :sigh: and :doh: smileys to the menu. Removed code that selects text after using Ctrl+Shift+6 to make a link[^] since the code in the posting page does that now.
  • v2.0.1 (July 12, 2003) - The SearchBar now works in MyIE2. The search edit box now resizes properly when you change the show button text option.
  • v2.0 (June 26, 2003) - Tons of new stuff. Site Links menu now built from an XML file. XML file updated automatically from CodeProject. New web service reader that shows the latest CodeProject articles and posts in the browser. Posting page enhancements and emoticon menu.
  • v1.2.5 (November 13, 2002) - Removed Wintellect from the Premium Sponsors list. Added Search CodeProject to Site Links menu. Now adding qm= query string to use advanced search options. Added options to control which type of search to use.
  • v1.2.4 (April 7, 2002) - Added chevron support! Added XP theme support. Added Wintellect premium sponsor. Fixed popup menus so they appear above the button (not covering it) when the browser window is near the bottom of the screen.
  • v1.2.3 (October 28, 2001) - Added "Premium Sponsors" submenu to the Site Links menu. Updated the icon (which shows up in Win 2000's Add/Remove Programs list) so it matches the alien icon on the site.
  • v1.2.2 (August 22, 2001) - Fixed the transparency bug so the rebar wallpaper will show through the toolbar. Fixed the code that tells IE the size of the band, so you can double-click the band's gripper and the toolbar will snap to just the right size. Added Ctrl+Enter key combo to do an author search. Updated graphics with the new logo. Updated the "advertising information" URL.
  • v1.2 (June 18, 2001) - Added site links: SearchBar Web Page, Surveys and Polls, My Code Project Bookmarks. Added two search items to the IE context menu for a web page. Added a toolbar option to automatically quote search words when doing a keyword search.
  • v1.1 (April 27, 2001) - Added the control menu to the CodeProject button. Added ability to show/hide toolbar button text.
  • v1.0 (April 22, 2001) - First release.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here