Click here to Skip to main content
15,917,568 members
Articles / Desktop Programming / ATL
Article

Creating DeskBands with an ATL Object Wizard

Rate me:
Please Sign up or sign in to vote.
4.97/5 (27 votes)
21 Mar 2001 798.5K   8K   182   228
An ATL Object Wizard that helps create a COM Object implementation of a DeskBand. Web Accessories for Internet Explorer and the Desktop. History, Favorites, Search, Radio, and Address Bands ... You have seen them since Internet Explorer 4.0. Now create your own!
  • Download Source Files - 32.3 Kb
  • Sample Image - RBDeskBand.gif

    What Are DeskBands?

    There are 4 types of deskbands. A Communications Band which sits at the bottom of an instance of IE4+. An Information Band sits on the left hand side of an instance of IE4+, like the search bar that allows you to search for files or folders on a hard drive. A Desk Band sits on the desktop, it can float or dock to any of the 4 sides of your monitor. The final type is a Toolbar which sits in the rebar space of Internet Explorer, like the address bar.

    To see this, start IE4+. Click the "View" menu item, go down to the "Explorer Bar" menu item. The top half above the seperator are the available Information Bands, the bottom half are the communication bands.

    To see a deskband, right click on the taskbar (area connected to the start button). Select the toolbar's menu item from the context menu. listed are the available deskbands.

    Deskbands can also reside as toolbars inside IE4+. The wizard does not currently provide this code although I do have it available. I will be updating the wizard in the next week or so to support toolbars and be more configurable.

    Installation

    In this version you no longer need the Microsoft Installer installed to be able to use this ATL Object Wizard. In the past the files were stored in an MSI file which would install the files to the correct location and allow for easy uninstalltion. To allow more people to use the Wizard. I have moved the files out of the MSI and leave it to the user to place them in the correct location using the instructions below.

    Steps:
    • Extract the files from the source zip above to your Visual Studio location under the following relative path Common\MSDev98\Template\ATL.
    • Run the RegSvr32.exe from a command prompt on RBDeskband.dll. RegSvr32 RBDeskBand

    Path Examples For Step 1:

    • C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Template\ATL
    • C:\MyDevEnv\Common\MSDev98\Template\ATL

    Usage

    To create a DeskBand base implementation, do the following:
    1. Start the ATL Object Wizard using the 'New ATL Object' option avalable from the Insert menu.
    2. Select the "DeskBand" ATL Object Wizard component from the "RadBytes" category.
    3. Fill in the Names Dialog page with your Deskband information.
    4. Select the "DeskBand ATL Object Wizard" Tab.
    5. Select at least one DeskBand type you want to expose your band as.
    6. Click Ok
    7. Your project will be updated with the associated class files needed to compile your base implemenation of a deskband.

    I Ran The Wizard But Now What?

    All that is required of you is to implement your content and inner workings for the band you created. A base window exists that is a static. This is there for easy pullout and inseration of any replacement code. I choose this instead of attaching a CWindowImpl directly to the deskband for ease of change, use, and adaptability.

    My Deskband Is Not Listed In The Menu Items

  • Make sure that you are looking at the correct list of menu items for the type of band you created.
  • Also remember that the explorer.exe process caches the list of Explorer Bars and Toolbars on first access of the menu for the life of your Windows session, not IE session. So if you have accessed the menu during this session you will either need to log off and log back on or kill the explorer.exe process.

    Auto Generated Code

    The output created is a Source, Header, and Registry Resource files from the Short Name supplied in the ATL Object Wizard property page. The files that get modified by the wizard are: your main source, IDL, RC, and DSP files.


    Unicode

    The code generated will compile both under UNICODE and ANSI.


    History

    1.1
    [March 22, 2001]
    Fixes:
  • Band Registration problem, Threading model was set to Single [Hwan, Erik Funkenbusch]
  • Removed MSI requirment. [Siddhartha Ghosal]
  • Removed the Thank you dialog. I decided it was annoying and useless.

    Additions:
  • Added new Wizard Page to allow creation of Band in multiple ways.
  • Added Internet Explorer toolbar support
  • Use ATL CATEGORY_MAP [Erik Funkenbusch]

    Outstanding Issues:
  • Testing has shown that adding numerous Bands to a project using the Wizard causes VC to insert #include directives at the bottom of the project source file. No known fix and infrequent occurance.
  • Adding multiple Internet Explorer Toolbars to one project will cause redefinition of HKEY hKeyLocal = NULL;. Fix is to remove redundant definition.
  • Initial Release
    [April 13, 2000]
    My first release of the ATL Object Wizard and article publishing.
  • 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


    Written By
    Web Developer
    United States United States
    Erik lives in Redmond, Washington. He works as a Senior Software Engineer specializing in C++, COM, ATL and the middle-tier and now .NET. When he isn't coding for work, he can be found trying to extend Internet Explorer with yet another Desk band or simplifying his development process with ATL Object Wizards.

    He spends his free time snowboarding, mountain biking, and online gaming.

    Comments and Discussions

     
    GeneralGreat Work Pin
    PrafullaT21-Jul-06 1:29
    PrafullaT21-Jul-06 1:29 
    GeneralVis. Studio 2005 Pin
    Hooked2564-Jul-06 4:15
    Hooked2564-Jul-06 4:15 
    GeneralRe: Vis. Studio 2005 Pin
    antSmallBug31-Jul-06 13:48
    antSmallBug31-Jul-06 13:48 
    GeneralRe: Vis. Studio 2005 Pin
    Erik Thompson13-Aug-06 19:28
    sitebuilderErik Thompson13-Aug-06 19:28 
    GeneralRe: Vis. Studio 2005 Pin
    ENin9tyThr3e25-Sep-06 17:36
    ENin9tyThr3e25-Sep-06 17:36 
    GeneralVS .Net port Pin
    joebarthib3-May-06 22:53
    joebarthib3-May-06 22:53 
    GeneralShow/Hide deskband programmatically Pin
    sherwani10-Apr-06 3:04
    sherwani10-Apr-06 3:04 
    AnswerRe: Show/Hide deskband programmatically Pin
    kellyjp7-Sep-06 14:37
    kellyjp7-Sep-06 14:37 
    I've been looking everywhere for a solution to this... but
    i've not found any solutions.

    I decided to tackle it with Windows Messages.
    Managed to get a working solution, but it's very hacky and requires
    some extra work (for reliability).

    Works fine on my XP SP2 - it's messy but at least it's an option.

     <br />
    /*************************************** <br />
     * Demo app for showing/hiding Deskbands <br />
     * using basic Windows Messages (Very Hacky) <br />
     * <br />
     * James Kelly 08/09/2006 <br />
     * <br />
     * Please use this as a template, and adapt it <br />
     * to your needs as you wish. <br />
     **************************************/ <br />
    #include <windows.h> <br />
    #include <stdio.h> <br />
    <br />
    //=========================================== <br />
    // Main Entry Point <br />
    //=========================================== <br />
    int main(int argc, char* argv[]) <br />
    { <br />
         HWND hParent = FindWindowEx(NULL, NULL, "Shell_TrayWnd", NULL); <br />
         if (hParent == NULL) return 0; <br />
    <br />
         hParent = FindWindowEx(hParent, NULL, "ReBarWindow32", NULL); <br />
         if (hParent == NULL) return 0; <br />
    <br />
         PostMessage(hParent, WM_CONTEXTMENU, (UINT)hParent, 0); <br />
    <br />
         Sleep(50);              // We should wait for the POST to be processed <br />
    <br />
         // TODO: No waiting. Hide the popup (SW_HIDE?) - can't be arsed. <br />
    <br />
         POINT pt = {0,0}; <br />
         HWND hPopupMenu = WindowFromPoint(pt); <br />
    <br />
         // Code below is aweful - need a more reliable way <br />
         // - an exercise for the reader :) <br />
         // ALT+<#> keys? / Direct Menu manipulation? <br />
    <br />
         // Find Toolbars submenu <br />
         PostMessage(hPopupMenu, WM_KEYDOWN, VK_DOWN, 0); <br />
         PostMessage(hPopupMenu, WM_KEYDOWN, VK_RIGHT, 0); <br />
    <br />
         // Select desired item <br />
         PostMessage(hPopupMenu, WM_KEYDOWN, VK_DOWN, 0); <br />
         PostMessage(hPopupMenu, WM_KEYDOWN, VK_DOWN, 0); <br />
         //PostMessage(hPopupMenu, WM_KEYDOWN, VK_DOWN, 0); <br />
         //PostMessage(hPopupMenu, WM_KEYDOWN, VK_DOWN, 0); <br />
         PostMessage(hPopupMenu, WM_KEYDOWN, VK_RETURN, 0); <br />
    <br />
         return 0; <br />
    } <br />


    This toggles the "Links" taskbar on and off on my box. Simple.

    Comments welcomed....

    James Kelly
    GeneralRe: Show/Hide deskband programmatically Pin
    faizur19-Nov-06 1:03
    faizur19-Nov-06 1:03 
    GeneralRe: Show/Hide deskband programmatically Pin
    XiaoAnn14-Jan-11 12:11
    XiaoAnn14-Jan-11 12:11 
    QuestionRe: Show/Hide deskband programmatically Pin
    rixwan11-Sep-07 1:28
    rixwan11-Sep-07 1:28 
    QuestionHow to catch ShellView Events Pin
    kil ramesh1-Feb-06 2:17
    kil ramesh1-Feb-06 2:17 
    AnswerRe: How to catch ShellView Events Pin
    Erik Thompson8-Feb-06 5:58
    sitebuilderErik Thompson8-Feb-06 5:58 
    GeneralRe: How to catch ShellView Events Pin
    ENin9tyThr3e3-Mar-06 15:30
    ENin9tyThr3e3-Mar-06 15:30 
    GeneralRe: How to catch ShellView Events Pin
    Erik Thompson13-Aug-06 19:31
    sitebuilderErik Thompson13-Aug-06 19:31 
    GeneralInternet Explorer Tool Band Pin
    palpha29-Nov-05 22:45
    palpha29-Nov-05 22:45 
    Generalwhy I can't correctly load this dll Pin
    wangshilei29-Apr-05 16:11
    wangshilei29-Apr-05 16:11 
    GeneralRe: why I can't correctly load this dll Pin
    Anonymous1-May-05 6:56
    Anonymous1-May-05 6:56 
    QuestionWindows Explorer as well? Pin
    Tabris_55531-Mar-05 9:10
    Tabris_55531-Mar-05 9:10 
    AnswerRe: Windows Explorer as well? Pin
    Erik Thompson31-Mar-05 9:53
    sitebuilderErik Thompson31-Mar-05 9:53 
    QuestionNewer version? Pin
    Miyu Yang26-Mar-05 0:06
    Miyu Yang26-Mar-05 0:06 
    GeneralUsing A DeskBand in the ActiveX Control Test Container Pin
    kpatelPro17-Mar-05 17:20
    kpatelPro17-Mar-05 17:20 
    GeneralRe: Using A DeskBand in the ActiveX Control Test Container Pin
    Erik Thompson18-Mar-05 6:39
    sitebuilderErik Thompson18-Mar-05 6:39 
    QuestionWhat I need to Make in .NET Pin
    Leandro H. Delamare16-Dec-04 0:14
    Leandro H. Delamare16-Dec-04 0:14 
    GeneralVB ActiveX control onto Toolbar Pin
    Brian Gould3-Dec-04 5:07
    Brian Gould3-Dec-04 5:07 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.