BCGControlBar Pro for MFC
CBCGPAppBarWnd

Detailed Description

An application desktop toolbar is a window that attaches itself to an edge of your screen. It registers with the system and reserves a part of the screen.

The CBCGPAppBarWnd class implements the following functionality:

  • dock to a screen edge
  • switch to autohide mode
  • float in the middle of the screen
  • free resizing in floating mode and one-dimension resizing when docked
  • can be dragged and re-docked with a mouse

To use the application bar you should first call the Create() member function. It's advisable to embed your custom window into the client area of the application bar. Call SetSide() to dock the application bar to the screen edge or Float() to enable floating mode. Use SetAlwaysOnTop() to switch to autohide mode and SetAutoHide() to manage always-on-top state.

The CBCGPAppBarWnd class registers with the system as application toolbar and handles in the AppBarCallback() callback-function all the application bar notification messages that system sent:

  • ABN_STATECHANGE
  • ABN_FULLSCREENAPP
  • ABN_POSCHANGED
  • ABN_WINDOWARRANGE

If you need special processing for these notifications, then you can override the appropriate virtual member function (see OnAppBarPosChanged(), OnAppBarFullScreenApp(), OnAppBarWindowArrange(), OnAppBarStateChange()).

To manage the application toolbar and communicate with the system the application bar uses the following system messages:

  • ABM_NEW
  • ABM_REMOVE
  • ABM_QUERYPOS
  • ABM_SETPOS
  • ABM_GETTASKBARPOS
  • ABM_GETSTATE
  • ABM_GETAUTOHIDEBAR
  • ABM_SETAUTOHIDEBAR
  • ABM_ACTIVATE

The CBCGPAppBarWnd class has wrapper functions for all these messages. Usually, you don't need to call directly any wrapper functions, the framework does all necessary calls.

See also
CBCGPAppBarWnd::APPBARSTATE, CBCGPAppBarWnd::AppBarCallback

Inherits CWnd.

Classes

struct  tagAPPBARSTATE
 

Public Member Functions

 AppBarCallbackHandles application bar notification messages.
 
 CreateCreates and registers application bar.
 
 FloatFloats an application bar on the screen.
 
 FloatFloats an application bar on the screen at specific location.
 
 GetAlwaysOnTopRetrieves the current always-on-top state.
 
 GetAutoHideReturns the current auto-hide state
 
 GetAutoHideBarRetrieve a handle to an autohide application bar associated with an edge of the screen.
 
 GetPosRetrieve the bounding rectangle of the Windows task bar.
 
 GetSideReturns the edge of the screen where the application bar is currently docked at.
 
 GetStateRetrieves the auto-hide and always-on-top states of the application bar.
 
 HideHides an application bar.
 
 LoadStateLoads application bar state from the registry.
 
 OnAppBarFullScreenAppCalled by the framework to handle the system ABN_FULLSCREENAPP message.
 
 OnAppBarPosChangedCalled by the framework to handle the system ABN_POSCHANGED notification.
 
 OnAppBarStateChangeCalled by the framework to handle the system ABN_STATECHANGE message.
 
 OnAppBarWindowArrangeCalled by the framework to handle the system ABN_WINDOWARRANGE message.
 
 QueryPosRequests a size and a screen position for an application bar.
 
 RegisterRegisters a new application bar.
 
 SaveStateSaves state of application bar.
 
 SetAlwaysOnTopEnables or disables the always-on-top mode.
 
 SetAutoHideEnable or disable auto-hiding.
 
 SetAutoHideBarRegister or unregister an auto-hide application bar
 
 SetPosSets the size and screen position of an application bar.
 
 SetSideDocks an application bar at the specified side of the screen.
 
 UnHideShows an application bar.
 
 UnRegisterUnregisters an application bar.
 

Protected Types

 APPBARSTATEThe structure holds main application bar settings.
 

Protected Attributes

 m_absStores the main application bar's settings.
 
 m_bDisableAnimationEnables or disables animation.
 
 m_dwFlagsCombination of flags applied to the application bar.
 
 m_hEmbeddedBarHandle of the embedded window.
 
 m_nCaptionHeightSpecifies the caption height of the application bar window.
 

Static Protected Attributes

 m_uAppBarNotifyMsgSpecifies the message identifier that the system should use to send the application bar notification messages.