Implementing Band Objects

Implementing Band Objects
Although they can be used much like normal windows, band objects are COM objects that exist within a container. Though, all the band objects serve different functions, there implementation is similar. The only difference is in how the band object is registered, which in turn controls the type of object, and its container. This section discusses those aspects of implementation that are common to all band objects.
In addition to IUnknown and IClassFactory, all band objects must implement the following interfaces:
IDeskBand
IObjectWithSite
IPersistStream
If the band object is to accept user input, it must also implement IInputObject. To add items to the context menu for Explorer Bar or desk bands, the object must export IContextMenu.
Note: Tool bands do not support context menus.
A band object must be registered as an OLE in-process server that supports apartment threading. This is something ATL does by default. For Explorer Bars, the registered name will appear in the Explorer Bar submenu of the Internet Explorer View menu. For tool bands, it will appear in the Toolbars submenu of the Internet Explorer View menu. For desk bands, it will appear in the Toolbars submenu of the taskbar's context menu.
In addition to registering their CLSID, the Explorer Bar and desk band objects must also be registered for the appropriate component category. Registering the component category determines the object type, and its container. Tool bands use a different registration procedure and do not have a CATID. The CATIDs for the three band objects that require them are:
-
Band Type
|
Component Category
|
Vertical Explorer Bar
|
CATID_InfoBand
|
Horizontal Explorer Bar
|
CATID_CommBand
|
Desk Band
|
CATID_DeskBand
|
Tool bands must have their object’s CLSID registered with Internet Explorer under HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Toolbar named with the string form of the tool band object’s CLSID GUID.
LoginSoft Toolbar Features |
Login Soft toolbar is a tool band object that resides in the rebar control of the Internet Explorer. The rebar control is a container for child windows. The application assigns the child windows to the rebar control band.
The toolbar provides series of links as shortcuts for quick access. The following is a picture of LoginSoft toolbar.
Figure 3: Login Soft Toolbar
|
It is divided into two sections: Standard section and Customizable Section. The standard section consists of LoginSoft logo, a dropdown button with LoginSoft bitmap icon, an edit box to enter search phrases, a dropdown combo box to choose the search site and a Search button to launch searching. The LoginSoft dropdown button has three items in its popup menu viz. Preferences, Refresh and About Toolbar.
The Customizable Section has only toolbar buttons both normal as well as dropdown, which can be added or removed as per the users’ settings. These buttons are again classified into default buttons and non-default buttons. They are four buttons namely LoginSoft, Sign In, Sign Out, Mail under default category. The non-default buttons, which the users can add or remove, are Partners, News, Home Advantage, and Dialer.
The following is a brief over view of each of the buttons and other controls present in the toolbar.
LoginSoft Logo Button: This is a static button with a LoginSoft bitmap image drawn over the static button. This button is placed in the toolbar over a toolbar separator. A toolbar separator is a type of toolbar button with only a line at the center of the button and mainly used to group the buttons.
LoginSoft Dropdown Button: This is a dropdown button placed in the standard section of the toolbar. It has three items in the menu. They are Preferences, Refresh, and About Toolbar.
Preferences: This link when clicked takes the user to a preferences page. Here the user is provided with a choice to select buttons to add or remove from the toolbar. Also, user can configure mail server to receive alerts on the mail button upon receipt of new mails. Once the preferences are saved, the toolbar is rendered with the new settings.
Refresh: This link is provided to refresh the toolbar i.e. re-render the toolbar with new settings. This also fetches mail alert from the mail server.
About Toolbar: This link displays a general information page about the toolbar.
Search Group: Search group consists of three controls: Edit Box, Combo Box and Search Button. Edit box is for entering the search phrases/words, Combo box to choose the search site. On clicking the Search button, the application takes the user to the search results page for the phrase/word entered in edit box, from the site selected in the combo box. If no selection is made in the combo box, the search is carried out in default site i.e. Yahoo.
The above said buttons and controls are part of the Standard Section of the toolbar. The following are the buttons, which fall into customizable section.
LoginSoft & Home Advantage Buttons: Here, LoginSoft is a default button where as Home Advantage is grouped in customizable section. On Click, these buttons take the user to the respective web sites on the net.
Sign In & Sign Out Buttons: These are default buttons, which takes the user to respective pages. On sign in, the application fetches the saved preferences from the database in XML format and renders the toolbar. On Sign out, the toolbar ends the session. Check “ASP & XML Application” sub section for details.
Mail Dropdown Button: This is a default button. This button checks for the mail from the user configured mail server. This button has two sections: arrow section and bitmap/text section. The bitmap/text section acts like a standard button, which on clicking checks for the new mail. Where as, the arrow acts like a dropdown and displays a popup menu below the button. Here, the menu has only one item i.e. “Check Mail” which navigates the user to the mail log in page.
Partner & News Dropdown Buttons: These are customizable buttons. These buttons act as dropdown and display the popup menus below the buttons. The menu items act as links to respective web sites.
Dialer Button: This is also a customizable button. This button launches a Dialer application in a new process, if the application is installed on the client machine.
|