![]() |
Web Development »
Applications & Tools »
CodeProject Tools
Intermediate
The Code Project Search BarBy Michael DunnThe Code Project SearchBar gives you quick access to the Code Project site, and lets you do searches at any time, from any web page. |
VC6Win2K, WinXP, Win2003, TabletPC, ATL, WTL, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
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]](CodeProjectSearchBar/sampletb.gif)
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.
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]](CodeProjectSearchBar/srchmenu.gif)
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]](CodeProjectSearchBar/dragdrop1.gif)
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]](CodeProjectSearchBar/dragdrop2.gif)
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]](CodeProjectSearchBar/iectxmenu.gif)
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]](CodeProjectSearchBar/sitelinks.gif)
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.
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]](CodeProjectSearchBar/websvcmenu.gif)
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]](CodeProjectSearchBar/websvclist.gif)
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.
Click the down arrow next to the CodeProject button to see the SearchBar's control menu:
![[Control menu - 5K]](CodeProjectSearchBar/ctrlmenu.gif)
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.
Click SearchBar Options to open the SearchBar options dialog. There are two pages, General and Signatures.
![[General options page - 52K]](CodeProjectSearchBar/optionsdlg.gif)
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]](CodeProjectSearchBar/notext.gif)
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.
![[Signatures options page - 50K]](CodeProjectSearchBar/optionsdlg2.gif)
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.
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:
![]()
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:
< > and & so C++ code doesn't get treated like HTML tags.
< > and & characters in the selected text to their HTML equivalents (handy for times when you copy C++ code from somewhere else).
<code> tags around the selected text (same as clicking the code button in the editing toolbar).
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]](CodeProjectSearchBar/tbinstall.gif)
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]](CodeProjectSearchBar/tbmenu.gif)
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.
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.)
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!
: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.
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 16 Jul 2005 Editor: Chris Maunder |
Copyright 2001 by Michael Dunn Everything else Copyright © CodeProject, 1999-2009 Web12 | Advertise on the Code Project |