Thread: How is a window like the MS OFFICE Suite Tools Bar created?

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    42

    How is a window like the MS OFFICE Suite Tools Bar created?

    Hi There,

    How is a window like the MS OFFICE Suite Tools Bar created at the right side of the windows desktop? For this kind of window, all other windows always are laid out side by side with it even if other windows are maximized. It keeps not overlapped by them.
    This kind of windows not just defines its own behaviours, but also changes other windows' too. It likes very much the windows TASK BAR.

    Thanks,

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    42
    Yes, It is. Thanks a lot.
    When I read the article, I find it is a little difficult to follow. I copy the example in it below.
    1. How is APPBAR_CALLBACK defined?
    // Provide an identifier for notification messages.
    abd.uCallbackMessage = APPBAR_CALLBACK;
    Can somebody show an example?
    Or is another fragment AppBarCallback in the article the one? But when I compile it, I got the following error:

    error C2440: '=' : cannot convert from 'void (__cdecl *)(struct HWND__ *,unsigned int,long)' to 'unsigned int'

    2. Is hwndAccessBar IN parameter or OUT?
    3. Where are the following variables defined?
    UINT g_uSide ?
    BOOL g_fAppRegistered?

    Code:
    // RegisterAccessBar - registers or unregisters an appbar. 
    // Returns TRUE if successful, or FALSE otherwise. 
    // hwndAccessBar - handle to the appbar 
    // fRegister - register and unregister flag 
    // 
    // Global variables 
    //     g_uSide - screen edge (defaults to ABE_TOP) 
    //     g_fAppRegistered - flag indicating whether the bar is registered 
    
    BOOL RegisterAccessBar(HWND hwndAccessBar, BOOL fRegister) 
    { 
        APPBARDATA abd; 
    
        // Specify the structure size and handle to the appbar. 
        abd.cbSize = sizeof(APPBARDATA); 
        abd.hWnd = hwndAccessBar; 
    
        if (fRegister) { 
    
            // Provide an identifier for notification messages. 
            abd.uCallbackMessage = APPBAR_CALLBACK; 
    
            // Register the appbar. 
            if (!SHAppBarMessage(ABM_NEW, &abd)) 
                return FALSE; 
    
            g_uSide = ABE_TOP;       // default edge 
            g_fAppRegistered = TRUE; 
    
        } else { 
    
            // Unregister the appbar. 
            SHAppBarMessage(ABM_REMOVE, &abd); 
            g_fAppRegistered = FALSE; 
        } 
    
        return TRUE; 
    
    }
    Thanks,

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. docking bar for window desktop screen
    By sgh in forum Windows Programming
    Replies: 3
    Last Post: 04-29-2008, 02:14 AM
  2. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 03:07 PM
  3. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  4. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM
  5. Status bar covering parent window....by the way, thanks Ward
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 10-02-2001, 08:16 PM