Rebar Controls

Rebar Controls


Rebar controls act as containers for child windows. An application assigns child windows, which are often other controls, to a rebar control band. Rebar controls contain one or more bands, and each band can have any combination of a gripper bar, a bitmap, a text label, and a child window. However, bands cannot contain more than one child window.

arrowy.gifAbout Rebar Controls

arrowy.gifUsing Rebar Controls

arrowy.gifRebar Control Reference

About Rebar Controls

A rebar control displays the child window over a specified background bitmap. As you dynamically reposition a rebar control band, the rebar control manages the size and position of the child window assigned to that band.

The following illustration shows a rebar control that has two bands. One contains a combo box, and the other contains a transparent toolbar control.

Rebar control with bands containing a combo box and a transparent toolbar control.

Note The rebar control is implemented in version 4.70 and later of Comctl32.dll.

Rebar Bands and Child Windows

An application defines a rebar band's traits by using the RB_INSERTBAND and RB_SETBANDINFO messages. These messages accept the address of a REBARBANDINFO structure as the lParam parameter. The REBARBANDINFO structure members define the traits of a given band. To set a band's traits, set the cbSize member to indicate the size of the structure, in bytes. Then set the fMask member to indicate which structure members your application is filling.

To assign a child window to a band, include the RBBIM_CHILD flag in the fMask member of the REBARBANDINFO structure, and then set the hwndChild member to the child window's handle. Applications can set the minimum allowable width and height of a child window in the cxMinChild and cyMinChild members.

When a rebar control is destroyed, it destroys any child windows assigned to the bands within it. To prevent the control from destroying child windows assigned to its bands, remove the bands by sending the RB_DELETEBAND message, and then reset the parent to another window with the SetParent function before destroying the rebar control.

The Rebar Control User Interface

All rebar control bands can be resized, except those that use the RBBS_FIXEDSIZE style. To resize or change the order of bands within the control, click and drag a band's gripper bar. The rebar control automatically resizes and repositions child windows assigned to its bands. Additionally, you can toggle the size of a band by clicking on the band text, if there is any.

The Rebar Control's Image List

If an application is using an image list with a rebar control, it must send the RB_SETBARINFO message before adding bands to the control. This message accepts the address of a REBARINFO structure as the lParam parameter. Before sending the message, prepare the REBARINFO structure by setting the cbSize member to the size of the structure, in bytes. Then, if the rebar control is going to display images on the bands, set the fMask member to the RBIM_IMAGELIST flag and assign an image list handle to the himl member. If the rebar will not use band images, set fMask to zero.

Rebar Control Message Forwarding

A rebar control forwards all WM_NOTIFY window messages to its parent window. Additionally, a rebar control forwards any messages sent to it from windows assigned to its bands, like WM_CHARTOITEM, WM_COMMAND, and others.

Custom Draw Support

Rebar controls support custom draw functionality. For more information, see About Custom Draw.

Using Rebar Controls

This section gives sample code that demonstrates how to implement a rebar control.

Creating a Rebar Control

An application creates a rebar control by calling the CreateWindowEx function, specifying REBARCLASSNAME as the window class. The application must first register the window class by calling the InitCommonControlsEx function, while specifying the ICC_COOL_CLASSES bit in the accompanying INITCOMMONCONTROLSEX structure.

The following sample creates a rebar control with two bands—one that contains a combo box and another that contains a toolbar. The sample includes the RBS_VARHEIGHT style to allow the control to use variable band height. After creating the rebar control, CreateRebar creates the child windows with calls to two application-defined functions, CreateComboBox and CreateToolbar. Before adding each band, CreateRebar initializes the cbSize member of the REBARBANDINFO structure, as required by the RB_INSERTBAND message. Then it sets the value of the structure's fMask member to reflect which members contain valid data. CreateRebar sets the cyMinChild member for each band to allow for the height of the control within it. The cxMinChild member is zero to allow the user to completely hide the control within a given band.

HWND WINAPI CreateRebar(HWND hwndOwner)
{
   REBARINFO     rbi;
   REBARBANDINFO rbBand;
   RECT          rc;
   HWND   hwndCB, hwndTB, hwndRB;
   DWORD  dwBtnSize;
   INITCOMMONCONTROLSEX icex;

   icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
   icex.dwICC   = ICC_COOL_CLASSES|ICC_BAR_CLASSES;
   InitCommonControlsEx(&icex);

   hwndRB = CreateWindowEx(WS_EX_TOOLWINDOW,
                           REBARCLASSNAME,
                           NULL,
                           WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|
                           WS_CLIPCHILDREN|RBS_VARHEIGHT|CCS_NODIVIDER,
                           0,0,0,0,
                           hwndOwner,
                           NULL,
                           g_hinst,
                           NULL);
   if(!hwndRB)
      return NULL;

   // Initialize and send the REBARINFO structure.
   rbi.cbSize = sizeof(REBARINFO);  // Required when using this struct.
   rbi.fMask  = 0;
   rbi.himl   = (HIMAGELIST)NULL;
   if(!SendMessage(hwndRB, RB_SETBARINFO, 0, (LPARAM)&rbi))
      return NULL;

   // Initialize structure members that both bands will share.
   rbBand.cbSize = sizeof(REBARBANDINFO);  // Required
   rbBand.fMask  = RBBIM_COLORS | RBBIM_TEXT | RBBIM_BACKGROUND | 
                   RBBIM_STYLE | RBBIM_CHILD  | RBBIM_CHILDSIZE | 
                   RBBIM_SIZE;
   rbBand.fStyle = RBBS_CHILDEDGE | RBBS_FIXEDBMP;
   rbBand.hbmBack= LoadBitmap(g_hinst, MAKEINTRESOURCE(IDB_BACKGRND));   
   
   // Create the combo box control to be added.
   hwndCB = CreateComboBox(hwndRB);
   
   // Set values unique to the band with the combo box.
   GetWindowRect(hwndCB, &rc);
   rbBand.lpText     = "Combo Box";
   rbBand.hwndChild  = hwndCB;
   rbBand.cxMinChild = 0;
   rbBand.cyMinChild = rc.bottom - rc.top;
   rbBand.cx         = 200;

   // Add the band that has the combo box.
   SendMessage(hwndRB, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);

   // Create the toolbar control to be added.
   hwndTB = CreateToolbar(hwndOwner, dwStyle);

   // Get the height of the toolbar.
   dwBtnSize = SendMessage(hwndTB, TB_GETBUTTONSIZE, 0,0);

   // Set values unique to the band with the toolbar.
   rbBand.lpText     = "Tool Bar";
   rbBand.hwndChild  = hwndTB;
   rbBand.cxMinChild = 0;
   rbBand.cyMinChild = HIWORD(dwBtnSize);
   rbBand.cx         = 250;

   // Add the band that has the toolbar.
   SendMessage(hwndRB, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);

   return (hwndRB);
}

Rebar Control Reference

This section contains information about the following new or updated API elements used with rebar controls.

Rebar Control Styles

Messages
RB_BEGINDRAG
RB_DELETEBAND
RB_DRAGMOVE
RB_ENDDRAG
RB_GETBANDBORDERS
RB_GETBANDCOUNT
RB_GETBANDINFO
RB_GETBARHEIGHT
RB_GETBARINFO
RB_GETBKCOLOR
RB_GETCOLORSCHEME
RB_GETDROPTARGET
RB_GETPALETTE
RB_GETRECT
RB_GETROWCOUNT
RB_GETROWHEIGHT
RB_GETTEXTCOLOR
RB_GETTOOLTIPS
RB_GETUNICODEFORMAT
RB_HITTEST
RB_IDTOINDEX
RB_INSERTBAND
RB_MAXIMIZEBAND
RB_MINIMIZEBAND
RB_MOVEBAND
RB_SETBANDINFO
RB_SETBARINFO
RB_SETBKCOLOR
RB_SETCOLORSCHEME
RB_SETPALETTE
RB_SETPARENT
RB_SETTEXTCOLOR
RB_SETTOOLTIPS
RB_SETUNICODEFORMAT
RB_SHOWBAND
RB_SIZETORECT

Notifications
NM_CUSTOMDRAW (rebar)
NM_NCHITTEST (rebar)
NM_RELEASEDCAPTURE (rebar)
RBN_AUTOSIZE
RBN_BEGINDRAG
RBN_CHILDSIZE
RBN_DELETEDBAND
RBN_DELETINGBAND
RBN_ENDDRAG
RBN_GETOBJECT
RBN_HEIGHTCHANGE
RBN_LAYOUTCHANGED

Structures
NMRBAUTOSIZE
NMREBAR
NMREBARCHILDSIZE
RBHITTESTINFO
REBARBANDINFO
REBARINFO

Rebar Control Styles

Rebar controls support a variety of control styles in addition to standard window styles.
RBS_AUTOSIZE Version 4.71. The rebar control will automatically change the layout of the bands when the size or position of the control changes. An RBN_AUTOSIZE notification will be sent when this occurs.
RBS_BANDBORDERS Version 4.70. The rebar control displays narrow lines to separate adjacent bands.
RBS_DBLCLKTOGGLE Version 4.71. The rebar band will toggle its maximized or minimized state when the user double-clicks on the band. Without this style, the maximized or minimized state is toggled when the user single-clicks on the band.
RBS_FIXEDORDER Version 4.70. The rebar control always displays bands in the same order. You can move bands to different rows, but the band order is static.
RBS_REGISTERDROP Version 4.71. The rebar control generates RBN_GETOBJECT notification messages when an object is dragged over a band in the control. To receive the RBN_GETOBJECT notifications, initialize OLE with a call to OleInitialize or CoInitialize.
RBS_TOOLTIPS Version 4.70. Not yet supported.
RBS_VARHEIGHT Version 4.70. The rebar control displays bands at the minimum required height, when possible. Without this style, the rebar control displays all bands at the same height, using the height of the tallest visible band to determine the height of other bands.
RBS_VERTICALGRIPPER Version 4.71. The size grip will be displayed vertically instead of horizontally in a vertical rebar control. This style is ignored for rebar controls that do not have the CCS_VERT style.

Rebar Control Messages

This section contains information about the messages used with rebar controls.

RB_BEGINDRAG
RB_BEGINDRAG
    wParam = (WPARAM)(UINT) uBand;
    lParam = (LPARAM)(DWORD)dwPos;

Puts the rebar control in drag-and-drop mode. This message does not cause a RBN_BEGINDRAG notification to be sent.

uBand
Zero-based index of the band that the drag-and-drop operation will affect.
dwPos
DWORD value that contains the starting mouse coordinates. The horizontal coordinate is contained in the LOWORD and the vertical coordinate is contained in the HIWORD. If you pass (DWORD)-1, the rebar control will use the position of the mouse the last time the control's thread called GetMessage or PeekMessage.

The RB_BEGINDRAG, RB_DRAGMOVE, and RB_ENDDRAG messages allow you to implement an IDropTarget interface for a rebar control. You send the RB_BEGINDRAG message in response to IDropTarget::DragEnter, send the RB_DRAGMOVE message in response to IDropTarget::DragOver, and the RB_ENDDRAG message in response to IDropTarget::Drop and IDropTarget::DragLeave.

Version 4.71

RB_DELETEBAND
RB_DELETEBAND
    wParam = (WPARAM)(UINT) uBand;
    lParam = 0;

Deletes a band from a rebar control.

uBand
Zero-based index of the band to be deleted.

Version 4.70

RB_DRAGMOVE
RB_DRAGMOVE
    wParam = 0;
    lParam = (LPARAM)(DWORD)dwPos;

Updates the drag position in the rebar control after a previous RB_BEGINDRAG message.

dwPos
DWORD value that contains the new mouse coordinates. The horizontal coordinate is contained in the LOWORD and the vertical coordinate is contained in the HIWORD. If you pass (DWORD)-1, the rebar control will use the position of the mouse the last time the control's thread called GetMessage or PeekMessage.

Version 4.71

See also RB_ENDDRAG

RB_ENDDRAG
RB_ENDDRAG
    wParam = 0;
    lParam = 0;

Terminates the rebar control's drag-and-drop operation. This message does not cause an RBN_ENDDRAG notification to be sent.

Version 4.71

See also RB_BEGINDRAG, RB_DRAGMOVE

RB_GETBANDBORDERS
RB_GETBANDBORDERS
    wParam = (WPARAM)(UINT) uBand;
    lParam = (LPARAM)(LPRECT) lprc;

Retrieves the borders of a band. The result of this message can be used to calculate the usable area in a band.

uBand
Zero-based index of the band for which the borders will be retrieved.
lprc
Address of a RECT structure that will receive the band borders. If the rebar control has the RBS_BANDBORDERS style, each member of this structure will receive the number of pixels, on the corresponding side of the band, that constitute the border. If the rebar control does not have the RBS_BANDBORDERS style, only the left member of this structure receives valid information.

Version 4.71

RB_GETBANDCOUNT
RB_GETBANDCOUNT
    wParam = 0;
    lParam = 0;

Retrieves the count of bands currently in the rebar control.

Version 4.70

RB_GETBANDINFO
RB_GETBANDINFO
    wParam = (WPARAM)(UINT) uBand;
    lParam = (LPARAM)(LPREBARBANDINFO) lprbbi;

Retrieves information about a specified band in a rebar control.

uBand
Zero-based index of the band for which the information will be retrieved.
lprbbi
Address of a REBARBANDINFO structure that will receive the requested band information. Before sending this message, you must set the cbSize member of this structure to the size of the REBARBANDINFO structure and set the fMask parameter to the items you want to retrieve.

Version 4.70

See also RB_SETBANDINFO

RB_GETBARHEIGHT
RB_GETBARHEIGHT
    wParam = 0;
    lParam = 0;

Retrieves the height of the rebar control.

Version 4.71

RB_GETBARINFO
RB_GETBARINFO
    wParam = 0;
    lParam = (LPARAM)(LPREBARINFO) lprbi;

Retrieves information about the rebar control and the image list it uses.

lprbi
Address of a REBARINFO structure that will receive the rebar control information. You must set the cbSize member of this structure to sizeof(REBARINFO) before sending this message.

Version 4.70

RB_GETBKCOLOR
RB_GETBKCOLOR
    wParam = 0;
    lParam = 0;

Retrieves a rebar control's default background color.

Version 4.71

See also RB_SETBKCOLOR

RB_GETDROPTARGET
RB_GETDROPTARGET
    wParam = 0;
    lParam = (IDropTarget**)ppDropTarget;

Retrieves a rebar control's IDropTarget interface pointer.

ppDropTarget
Address of an IDropTarget pointer that receives the interface pointer. It is the caller's responsibility to call Release on this pointer when it is no longer needed.

Version 4.71

RB_GETCOLORSCHEME
RB_GETCOLORSCHEME
    wParam = 0;
    lParam = (LPARAM)(LPCOLORSCHEME) lpcs;

Retrieves the color scheme information from the rebar control.

lpcs
Address of a COLORSCHEME structure that will receive the color scheme information. You must set the cbSize member of this structure to sizeof(COLORSCHEME) before sending this message.

Version 4.71

See also RB_SETCOLORSCHEME

RB_GETPALETTE
RB_GETPALETTE
    wParam = 0;
    lParam = 0;

Retrieves the rebar control's current palette.

Version 4.71

See also RB_SETPALETTE

RB_GETRECT
RB_GETRECT
    wParam = (WPARAM)(INT) iBand;
    lParam = (LPARAM)(LPRECT) lprc;

Retrieves the bounding rectangle for a given band in a rebar control.

iBand
Zero-based index of a band in the rebar control.
lprc
Address of a RECT structure that will receive the bounds of the rebar band.

Version 4.71

RB_GETROWCOUNT
RB_GETROWCOUNT
    wParam = 0;
    lParam = 0;

Retrieves the number of rows of bands in a rebar control.

Version 4.70

RB_GETROWHEIGHT
RB_GETROWHEIGHT
    wParam = (WPARAM)(UINT) uRow;
    lParam = 0;

Retrieves the height of a specified row in a rebar control.

uRow
Zero-based index of a band. The height of the row that contains the specified band will be retrieved.

To retrieve the number of rows in a rebar control, use the RB_GETROWCOUNT message.

Version 4.70

RB_GETTEXTCOLOR
RB_GETTEXTCOLOR
    wParam = 0;
    lParam = 0;

Retrieves a rebar control's default text color.

Version 4.71

See also RB_SETTEXTCOLOR

RB_GETTOOLTIPS
RB_GETTOOLTIPS
    wParam = 0;
    lParam = 0;

Retrieves the handle to any tooltip control associated with the rebar control.

Version 4.71

RB_GETUNICODEFORMAT
RB_GETUNICODEFORMAT
    wParam = 0;
    lParam = 0;

Retrieves the UNICODE character format flag for the control.

See also RB_SETUNICODEFORMAT

RB_HITTEST
RB_HITTEST
    wParam = 0;
    lParam = (LPARAM)(LPRBHITTESTINFO) lprbht;

Determines which portion of a rebar band is at a given point on the screen, if a rebar band exists at that point.

lprbht
Address of an RBHITTESTINFO structure. Before sending the message, the pt member of this structure must be initialized to the point that will be hit tested, in client coordinates.

Version 4.71

RB_IDTOINDEX
RB_IDTOINDEX
    wParam = (WPARAM)(UINT) uBandID;
    lParam = 0;

Converts a band identifier to a band index in a rebar control.

uBandID
The application-defined identifier of the band in question. This is the value that was passed in the wID member of the REBARBANDINFO structure when the band was inserted.

Version 4.71

RB_INSERTBAND
RB_INSERTBAND
    wParam = (WPARAM)(UINT) uIndex;
    lParam = (LPARAM)(LPREBARBANDINFO) lprbbi;

Inserts a new band in a rebar control.

uIndex
Zero-based index of the location where the band will be inserted. If you set this parameter to -1, the control will add the new band at the last location.
lprbbi
Address of a REBARBANDINFO structure that defines the band to be inserted. You must set the cbSize member of this structure to sizeof(REBARBANDINFO) before sending this message.

Version 4.70

RB_MAXIMIZEBAND
RB_MAXIMIZEBAND
    wParam = (WPARAM)(UINT) uBand;
    lParam = (LPARAM)(BOOL) fIdeal;

Resizes a band in a rebar control to either its ideal or largest size.

uBand
Zero-based index of the band to be maximized.
fIdeal
Indicates if the ideal width of the band should be used when the band is maximized. If this value is nonzero, the ideal width will be used. If this value is zero, the band will be made as large as possible.

Version 4.71

RB_MINIMIZEBAND
RB_MINIMIZEBAND
    wParam = (WPARAM)(UINT) uBand;
    lParam = 0;

Resizes a band in a rebar control to its smallest size.

uBand
Zero-based index of the band to be minimized.

Version 4.71

RB_MOVEBAND
RB_MOVEBAND
    wParam = (WPARAM)(UINT) iFrom;
    lParam = (LPARAM)(UINT) iTo;

Moves a band from one index to another.

iFrom
Zero-based index of the band to be moved.
iTo
Zero-based index of the new band position.

This message will most likely change the index of other bands in the rebar control. If a band is moved from index 6 to index 0, all of the bands in between will have their index incremented by one.

iTo must never be greater than the number of bands minus one. The number of bands can be obtained with the RB_GETBANDCOUNT message.

Version 4.71

RB_SETBANDINFO
RB_SETBANDINFO
    wParam = (WPARAM)(UINT) uBand;
    lParam = (LPARAM)(LPREBARBANDINFO) lprbbi;

Sets characteristics of an existing band in a rebar control.

uBand
Zero-based index of the band to receive the new settings.
lprbbi
Address of a REBARBANDINFO structure that defines the band to be modified and the new settings. You must set the cbSize member of this structure to sizeof(REBARBANDINFO) before sending this message.

Version 4.70

RB_SETBARINFO
RB_SETBARINFO
    wParam = 0;
    lParam = (LPARAM)(LPREBARINFO) lprbi;

Sets the characteristics of a rebar control.

lprbi
Address of a REBARINFO structure that contains the information to be set. You must set the cbSize member of this structure to sizeof(REBARINFO) before sending this message.

Version 4.70

RB_SETBKCOLOR
RB_SETBKCOLOR
    wParam = 0;
    lParam = (LPARAM)(COLORREF)clrBk;

Sets a rebar control's default background color.

clrBk
COLORREF value that represents the new default background color.

The rebar control's default background color is used to draw the background in a rebar control and all bands that are added after this message has been sent. The default background color for a particular band can be overridden when a band is added or modified by setting the RBBIM_COLORS flag in fMask and setting clrBack in the REBARBANDINFO structure.

Version 4.71

See also RB_GETBKCOLOR

RB_SETCOLORSCHEME
RB_SETCOLORSCHEME
    wParam = 0;
    lParam = (LPARAM)(LPCOLORSCHEME) lpcs;

Sets the color scheme information for the rebar control.

lpcs
Address of a COLORSCHEME structure that contains the color scheme information.

The rebar control uses the color scheme information when drawing the 3-D elements in the control and bands.

Version 4.71

See also RB_GETCOLORSCHEME

RB_SETPALETTE
RB_SETPALETTE
    wParam = 0;
    lParam = (LPARAM)(HPALETTE) hpal;

Sets the rebar control's current palette.

hpal
An HPALETTE that specifies the new palette that the rebar control will use.

It is the responsibility of the application sending this message to delete the HPALETTE passed in this message (see DeleteObject). The rebar control will not delete an HPALETTE set with this message.

Version 4.71

See also RB_GETPALETTE

RB_SETPARENT
RB_SETPARENT
    wParam = (WPARAM)(HWND) hwndParent;
    lParam = 0;

Sets a rebar control's parent window.

hwndParent
Handle to the parent window to be set.

The rebar control sends notification messages to the window you specify with this message. This message does not actually change the parent of the rebar control.

Version 4.70

RB_SETTEXTCOLOR
RB_SETTEXTCOLOR
    wParam = 0;
    lParam = (LPARAM)(COLORREF)clrText;

Sets a rebar control's default text color.

clrText
COLORREF value that represents the new default text color.

The rebar control's default text color is used to draw the text in a rebar control and all bands that are added after this message has been sent. The default text color for a particular band can be overridden when a band is added or modified by setting the RBBIM_COLORS flag in fMask and setting clrFore in the REBARBANDINFO structure.

Version 4.71

See also RB_GETTEXTCOLOR

RB_SETTOOLTIPS
RB_SETTOOLTIPS
    wParam = (WPARAM)(HWND) hwndToolTip;
    lParam = 0;

Associates a tooltip control with the rebar control.

hwndToolTip
Handle to the tooltip control to be set.

Version 4.71

RB_SETUNICODEFORMAT
RB_SETUNICODEFORMAT
    wParam = (WPARAM)(BOOL)fUnicode;
    lParam = 0;

Sets the UNICODE character format flag for the control. This message allows you to change the character set used by the control at run time rather than having to re-create the control.

fUnicode
Determines the character set that is used by the control. If this value is nonzero, the control will use UNICODE characters. If this value is zero, the control will use ANSI characters.

See also RB_GETUNICODEFORMAT

RB_SHOWBAND
RB_SHOWBAND
    wParam = (WPARAM)(INT) iBand;
    lParam = (LPARAM)(BOOL) fShow;

Shows or hides a given band in a rebar control.

iBand
Zero-based index of a band in the rebar control.
fShow
Boolean value that indicates if the band should be shown or hidden. If this value is nonzero, the band will be shown. Otherwise, the band will be hidden.

Version 4.71

RB_SIZETORECT
RB_SIZETORECT
    wParam = 0;
    lParam = (LPARAM)(LPRECT) prc;

Attempts to find the best layout of the bands for the given rectangle.

prc
Address of a RECT structure that specifies the rectangle to which the rebar control should be sized.

The rebar bands will be arranged and wrapped as necessary to fit the rectangle. Bands that have the RBBS_VARIABLEHEIGHT style will be resized as evenly as possible to fit the rectangle. The height of a horizontal rebar or the width of a vertical rebar may change, depending on the new layout.

Version 4.71

Rebar Control Notification Messages

This section contains information about the rebar control notification messages.

NM_CUSTOMDRAW (rebar)
NM_CUSTOMDRAW
    lpNMCustomDraw = (LPNMCUSTOMDRAW) lParam;

Sent by the rebar control to notify its parent window about drawing operations. This notification is sent in the form of a WM_NOTIFY message.

lpNMCustomDraw
Address of an NMCUSTOMDRAW structure that contains information about the drawing operation.

Version 4.70

See also Using Custom Draw

NM_NCHITTEST (rebar)
NM_NCHITTEST
    lpnmmouse = (LPNMMOUSE) lParam;

Sent by a rebar control when the control receives a WM_NCHITTEST message. This notification message is sent in the form of a WM_NOTIFY message.

lpnmmouse
Address of an NMMOUSE structure that contains information about the notification. The dwItemSpec member contains the band index over which the hit test message occurred, and the pt member contains the mouse coordinates of the hit test message.

Version 4.71

NM_RELEASEDCAPTURE (rebar)
NM_RELEASEDCAPTURE
    lpnmh = (LPNMHDR) lParam; 

Notifies a rebar control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.

lpnmh
Address of an NMHDR structure that contains additional information about this notification message.

Version 4.71.

RBN_AUTOSIZE
RBN_AUTOSIZE
    lpnmas = (LPNMRBAUTOSIZE) lParam;

Sent by a rebar control created with the RBS_AUTOSIZE style when the rebar automatically resizes itself. This notification message is sent in the form of a WM_NOTIFY message.

lpnmas
Address of an NMRBAUTOSIZE structure that contains information about the resize operation.

Version 4.71

RBN_BEGINDRAG
RBN_BEGINDRAG
    lpnmrb = (LPNMREBAR)lParam;

Sent by a rebar control when the user begins dragging a band. This notification message is sent in the form of a WM_NOTIFY message.

lpnmrb
Address of an NMREBAR structure that contains information about the notification.

Version 4.71

RBN_CHILDSIZE
RBN_CHILDSIZE
    lprbcs = (LPNMREBARCHILDSIZE)lParam;

Sent by a rebar control when a band's child window is resized. This notification message is sent in the form of a WM_NOTIFY message.

lprbcs
Address of an NMREBARCHILDSIZE structure that contains information about the notification.

Version 4.71

RBN_DELETEDBAND
RBN_DELETEDBAND
    lpnmrb = (LPNMREBAR)lParam;

Sent by a rebar control after a band has been deleted. This notification message is sent in the form of a WM_NOTIFY message.

lpnmrb
Address of an NMREBAR structure that contains information about the notification.

Version 4.71

RBN_DELETINGBAND
RBN_DELETINGBAND
    lpnmrb = (LPNMREBAR)lParam;

Sent by a rebar control when a band is about to be deleted. This notification message is sent in the form of a WM_NOTIFY message.

lpnmrb
Address of an NMREBAR structure that contains information about the notification.

Version 4.71

RBN_ENDDRAG
RBN_ENDDRAG
    lpnmrb = (LPNMREBAR)lParam;

Sent by a rebar control when the user stops dragging a band. This notification message is sent in the form of a WM_NOTIFY message.

lpnmrb
Address of an NMREBAR structure that contains information about the notification.

Version 4.71

RBN_GETOBJECT
RBN_GETOBJECT
    lpnmon = (LPNMOBJECTNOTIFY) lParam;

Sent by a rebar control created with the RBS_REGISTERDROP style when an object is dragged over a band in the control. This notification message is sent in the form of a WM_NOTIFY message.

lpnmon
Address of an NMOBJECTNOTIFY structure that contains information about the band that the object is dragged over and also receives the data provided by the receiving application in response to this message.

To receive the RBN_GETOBJECT notification, initialize OLE with a call to OleInitialize or CoInitialize.

Version 4.71

RBN_HEIGHTCHANGE
RBN_HEIGHTCHANGE
    lpnmhdr = (LPNMHDR) lParam;

Sent by a rebar control when its height has changed. This notification message is sent in the form of a WM_NOTIFY message.

lpnmhdr
Address of an NMHDR structure that contains additional information about this notification message.

Rebar controls that use the CCS_VERT style send this notification message when their width changes.

Version 4.70

RBN_LAYOUTCHANGED
RBN_LAYOUTCHANGED 
    lpnmhdr = (LPNMHDR) lParam;

Sent by a rebar control when the user changes the layout of the control's bands. This notification message is sent in the form of a WM_NOTIFY message.

lpnmhdr
Address of an NMHDR structure that contains additional information about this notification message.

Version 4.71

Rebar Control Structures

This section contains information about the structures used with rebar controls.

NMRBAUTOSIZE
typedef struct tagNMRBAUTOSIZE {
    NMHDR hdr;
    BOOL fChanged;
    RECT rcTarget;
    RECT rcActual;
} NMRBAUTOSIZE, *LPNMRBAUTOSIZE;

Contains information used in handling the RBN_AUTOSIZE notification messages.

hdr
NMHDR structure that contains additional information about the notification message.
fChanged
Member that indicates if the size or layout of the rebar control has changed (nonzero if a change occurred or zero otherwise).
rcTarget
RECT structure that contains the rectangle to which the rebar control tried to size itself.
rcActual
RECT structure that contains the rectangle to which the rebar control actually sized itself.

Version 4.71

NMREBAR
typedef struct tagNMREBAR {
    NMHDR hdr;
    DWORD dwMask;
    UINT uBand;
    UINT fStyle;
    UINT wID;
    LPARAM lParam;
} NMREBAR, *LPNMREBAR;

Contains information used in handling various rebar notification messages.

hdr
NMHDR structure that contains additional information about the notification message.
dwMask
Set of flags that define which members of this structure contain valid information. This can be one or more of the following values:
RBNM_ID The wID member contains valid information.
RBNM_LPARAM The lParam member contains valid information.
RBNM_STYLE The fStyle member contains valid information.
uBand
Zero-based index of the band affected by the notification. This will be -1 if no band is affected.
fStyle
The style of the band. This is one or more of the RBBS_ styles detailed in the fStyle member of the REBARBANDINFO structure. This member is only valid if dwMask contains RBNM_STYLE.
wID
Application-defined identifier of the band. This member is only valid if dwMask contains RBNM_ID.
lParam
Application-defined 32-bit value associated with the band. This member is only valid if dwMask contains RBNM_LPARAM.

Version 4.71

NMREBARCHILDSIZE
typedef struct tagNMREBARCHILDSIZE{
    NMHDR hdr;
    UINT uBand;
    UINT wID;
    RECT rcChild;
    RECT rcBand;
} NMREBARCHILDSIZE, *LPNMREBARCHILDSIZE; 

Contains information used in handling the RBN_CHILDSIZE notification message.

hdr
NMHDR structure that contains additional information about the notification message.
uBand
Zero-based index of the band affected by the notification. This will be -1 if no band is affected.
wID
Application-defined identifier of the band.
rcChild
RECT structure that contains the new size of the child window. This member can be changed during the notification to modify the child window's position and size.
rcBand
RECT structure that contains the new size of the band.

Version 4.71

RBHITTESTINFO
typedef struct _RB_HITTESTINFO {
    POINT pt;
    UINT  flags;
    int   iBand;
} RBHITTESTINFO, FAR *LPRBHITTESTINFO;

Contains information specific to a hit test operation. This structure is used with the RB_HITTEST message.

pt
POINT structure that describes the point to be hit tested, in client coordinates.
flags
Member that receives a flag value indicating the rebar band's component located at the point described by pt. This member will be one of the following:
RBHT_CAPTION The point was in the rebar band's caption.
RBHT_CLIENT The point was in the rebar band's client area.
RBHT_GRABBER The point was in the rebar band's gripper.
RBHT_NOWHERE The point was not in a rebar band.
iBand
Member that receives the rebar band's index at the point described by pt. This value will be the zero-based index of the band, or -1 if no band was at the hit-tested point.

Version 4.71

REBARBANDINFO
typedef struct tagREBARBANDINFO{
    UINT        cbSize;
    UINT        fMask;
    UINT        fStyle;
    COLORREF    clrFore;
    COLORREF    clrBack;
    LPTSTR      lpText;
    UINT        cch;
    int         iImage;
    HWND        hwndChild;
    UINT        cxMinChild;
    UINT        cyMinChild;
    UINT        cx;
    HBITMAP     hbmBack;
    UINT        wID;
#if (_WIN32_IE >= 0x0400)
    UINT        cyChild;  
    UINT        cyMaxChild;
    UINT        cyIntegral;
    UINT        cxIdeal;
    LPARAM      lParam;
    UINT        cxHeader;
#endif
 } REBARBANDINFO, FAR *LPREBARBANDINFO;

Contains information that defines a band in a rebar control.

cbSize
Size of this structure, in bytes. Your application must fill this member before sending any messages that use the address of this structure as a parameter.
fMask
Flags that indicate which members of this structure are valid or must be filled. This value can be a combination of the following:
RBBIM_BACKGROUND The hbmBack member is valid or must be filled.
RBBIM_CHILD The hwndChild member is valid or must be filled.
RBBIM_CHILDSIZE The cxMinChild and cyMinChild members are valid or must be filled.
RBBIM_COLORS The clrFore and clrBack members are valid or must be filled.
RBBIM_HEADERSIZE Version 4.71. The cxHeader member is valid or must be filled.
RBBIM_IDEALSIZE Version 4.71. The cxIdeal member is valid or must be filled.
RBBIM_ID The wID member is valid or must be filled.
RBBIM_IMAGE The iImage member is valid or must be filled.
RBBIM_LPARAM Version 4.71. The lParam member is valid or must be filled.
RBBIM_SIZE The cx member is valid or must be filled.
RBBIM_STYLE The fStyle member is valid or must be filled.
RBBIM_TEXT The lpText member is valid or must be filled.
fStyle
Flags that specify the band style. This value can be a combination of the following:
RBBS_BREAK The band is on a new line.
RBBS_CHILDEDGE The band has an edge at the top and bottom of the child window.
RBBS_FIXEDBMP The background bitmap does not move when the band is resized.
RBBS_FIXEDSIZE The band can't be sized. With this style, the sizing grip is not displayed on the band.
RBBS_GRIPPERALWAYS Version 4.71. The band will always have sizing grip, even if it is the only band in the rebar.
RBBS_HIDDEN The band will not be visible.
RBBS_NOGRIPPER Version 4.71. The band will never have sizing grip, even if there is more than one band in the rebar.
RBBS_NOVERT The band won't be displayed when the rebar control uses the CCS_VERT style.
RBBS_VARIABLEHEIGHT Version 4.71. The band can be resized by the rebar control. cyIntegral and cyMaxChild affect how the rebar will resize the band.
clrFore and clrBack
Band foreground and background colors. If hbmBack specifies a background bitmap, these members are ignored. By default, the band will use the background color of the rebar control set with the RB_SETBKCOLOR message. If a background color is specified here, then this background color will be used instead.
lpText
Address of a buffer that contains the display text for the band. If band information is being requested from the control and RBBIM_TEXT is specified in fMask, this member must be initialized to the address of the buffer that will receive the text.
cch
Size of the buffer at lpText, in bytes. If information is not being requested from the control, this member is ignored.
iImage
Zero-based index of any image that should be displayed in the band. The image list is set using the RB_SETBARINFO message.
hwndChild
Handle to the child window contained in the band, if any.
cxMinChild
Minimum width of the child window, in pixels. The band can't be sized smaller than this value.
cyMinChild
Minimum height of the child window, in pixels. The band can't be sized smaller than this value.
cx
Length of the band, in pixels.
hbmBack
Handle to a bitmap that is used as the background for this band.
wID
UINT value that the control uses to identify this band for custom draw notification messages. This value may be used for additional purposes in the future.
cyChild
Version 4.71. Initial height of the band, in pixels. This member is ignored unless the RBBS_VARIABLEHEIGHT style is specified.
cyMaxChild
Version 4.71. Maximum height of the band, in pixels. This member is ignored unless the RBBS_VARIABLEHEIGHT style is specified.
cyIntegral
Version 4.71. Specifies the step value by which the band can grow or shrink, in pixels. If the band is resized, it will be resized in steps specified by this value. This member is ignored unless the RBBS_VARIABLEHEIGHT style is specified.
cxIdeal
Version 4.71. Specifies the ideal width of the band, in pixels. If the band is maximized to the ideal width (see RB_MAXIMIZEBAND), the rebar control will attempt to make the band this width.
lParam
Version 4.71. A 32-bit application-defined value.
cxHeader
Version 4.71. Specifies the size of the band's header, in pixels. The band header is the area between the edge of the band and the edge of the child window. This is the area where band text and images are displayed, if they are specified. If this value is specified, it will override the normal header dimensions that the control calculates for the band.

The cxMinChild, cyMinChild, and cx members provide information on dimensions relative to the orientation of the control. That is, for a horizontal rebar control, cxMinChild and cx are horizontal measurements and cyMinChild is a vertical measurement. However, if the control uses the CCS_VERT style, cxMinChild and cx are vertical measurements and cyMinChild is a horizontal measurement.

Version 4.70

REBARINFO
typedef struct tagREBARINFO{
    UINT        cbSize;
    UINT        fMask;
    HIMAGELIST  himl;
} REBARINFO, FAR *LPREBARINFO;

Contains information that describes rebar control characteristics.

cbSize
Size of this structure, in bytes. Your application must fill this member before sending any messages that use the address of this structure as a parameter.
fMask
Flag values that describe characteristics of the rebar control. Currently, rebar controls support only one value:
RBIM_IMAGELIST The himl member is valid or must be filled.
himl
Handle to an image list. The rebar control will use the specified image list to obtain images.

Version 4.70

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.