TB_CHECKBUTTON
Toolbar Control Reference

TB_CHECKBUTTON


TB_CHECKBUTTON 
    wParam = (WPARAM) idButton; 
    lParam = (LPARAM) MAKELONG(fCheck, 0); 

Checks or unchecks a given button in a toolbar.

idButton
Command identifier of the button to check.
fCheck
Check flag. If this parameter is TRUE, the check is added. If it is FALSE, the check is removed.

When a button is checked, it is displayed in the pressed state.

TB_COMMANDTOINDEX

TB_COMMANDTOINDEX 
    wParam = (WPARAM) idButton; 
    lParam = 0; 

Retrieves the zero-based index for the button associated with the specified command identifier.

idButton
Command identifier associated with the button.

TB_CUSTOMIZE

TB_CUSTOMIZE 
    wParam = 0; 
    lParam = 0; 

Displays the Customize Toolbar dialog box.

TB_DELETEBUTTON

TB_DELETEBUTTON 
    wParam = (WPARAM) iButton; 
    lParam = 0; 

Deletes a button from the toolbar.

iButton
Zero-based index of the button to delete.

TB_ENABLEBUTTON

TB_ENABLEBUTTON 
    wParam = (WPARAM) idButton; 
    lParam = (LPARAM) MAKELONG(fEnable, 0); 

Enables or disables the specified button in a toolbar.

idButton
Command identifier of the button to enable or disable.
fEnable
Enable flag. If this parameter is TRUE, the button is enabled. If it is FALSE, the button is disabled.

When a button has been enabled, it can be pressed and checked.

TB_GETANCHORHIGHLIGHT

TB_GETANCHORHIGHLIGHT
    wParam = 0;
    lParam = 0;

Retrieves the anchor highlight setting for a toolbar.

Version 4.71

See also TB_SETANCHORHIGHLIGHT

TB_GETBITMAP

TB_GETBITMAP 
    wParam = (WPARAM) idButton; 
    lParam = 0; 

Retrieves the index of the bitmap associated with a button in a toolbar.

idButton
Command identifier of the button whose bitmap index is to be retrieved.

TB_GETBITMAPFLAGS

TB_GETBITMAPFLAGS
    wParam = 0;
    lParam = 0;

Retrieves the flags for the current bitmap.

TB_GETBUTTON

TB_GETBUTTON 
    wParam = (WPARAM) iButton; 
    lParam = (LPARAM) (LPTBBUTTON) lpButton; 

Retrieves information about the specified button in a toolbar.

iButton
Zero-based index of the button for which to retrieve information.
lpButton
Address of the TBBUTTON structure that receives the button information.

TB_GETBUTTONINFO

TB_GETBUTTONINFO
    wParam = (WPARAM)(INT) iID;
    lParam = (LPARAM)(LPTBBUTTONINFO) lptbbi;

Retrieves extended information for a button in a toolbar.

iID
Button identifier.
lptbbi
Address of a TBBUTTONINFO structure that receives the button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.

Version 4.71

TB_GETBUTTONSIZE

TB_GETBUTTONSIZE
    wParam = 0;
    lParam = 0;

Retrieves the current width and height of toolbar buttons, in pixels.

Version 4.70.

TB_GETBUTTONTEXT

TB_GETBUTTONTEXT 
    wParam = (WPARAM) idButton; 
    lParam = (LPARAM) (LPSTR) lpszText; 

Retrieves the text of a button in a toolbar.

idButton
Command identifier of the button whose text is to be retrieved.
lpszText
Address of a buffer that receives the button text.

TB_GETCOLORSCHEME

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

Retrieves the color scheme information from the toolbar 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 TB_SETCOLORSCHEME

TB_GETDISABLEDIMAGELIST

TB_GETDISABLEDIMAGELIST
    wParam = 0;
    lParam = 0;

Retrieves the image list that a toolbar control uses to display disabled buttons.

Version 4.70.

TB_GETEXTENDEDSTYLE

TB_GETEXTENDEDSTYLE
    wParam = 0;
    lParam = 0;

Retrieves the extended styles for a toolbar control.

Version 4.71

See also TB_SETEXTENDEDSTYLE

TB_GETHOTIMAGELIST

TB_GETHOTIMAGELIST
    wParam = 0;
    lParam = 0;

Retrieves the image list that a toolbar control uses to display hot buttons. A button is hot when the pointer is above it.

Version 4.70.

TB_GETHOTITEM

TB_GETHOTITEM
    wParam = 0;
    lParam = 0;

Retrieves the index of the hot item in a toolbar.

Version 4.71

TB_GETIMAGELIST

TB_GETIMAGELIST
    wParam = 0;
    lParam = 0;

Retrieves the image list that a toolbar control uses to display buttons in their default state. A toolbar control uses this image list to display buttons when they are not hot or disabled.

Version 4.70.

TB_GETINSERTMARK

TB_GETINSERTMARK
    wParam = 0;
    lParam = (LPARAM)(LPTBINSERTMARK)lptbim;

Retrieves the current insertion mark for the toolbar.

lptbim
Address of a TBINSERTMARK structure that receives the insertion mark.

Version 4.71

See also TB_SETINSERTMARK

TB_GETINSERTMARKCOLOR

TB_GETINSERTMARKCOLOR
    wParam = 0;
    lParam = 0;

Retrieves the color used to draw the insertion mark for the toolbar.

Version 4.71

See also TB_SETINSERTMARKCOLOR

TB_GETITEMRECT

TB_GETITEMRECT
    wParam = (WPARAM) iButton; 
    lParam = (LPARAM) (LPRECT) lprc; 

Retrieves the bounding rectangle of a button in a toolbar.

iButton
Zero-based index of the button for which to retrieve information.
lprc
Address of a RECT structure that receives the coordinates of the bounding rectangle.

This message does not retrieve the bounding rectangle for buttons whose state is set to the TBSTATE_HIDDEN value.

TB_GETMAXSIZE

TB_GETMAXSIZE
    wParam = 0;
    lParam = (LPARAM)(LPSIZE)lpSize;

Retrieves the total size of all of the visible buttons and separators in the toolbar.

lpSize
Address of a SIZE structure that receives the size of the items.

Version 4.71

TB_GETOBJECT

TB_GETOBJECT
    wParam = (WPARAM) (REFIID) iid;
    lParam = (LPARAM) (LPVOID*) ppvObject;

Retrieves the IDropTarget for a toolbar control.

iid
Identifier of the interface being requested. This value must point to IID_IDropTarget.
ppvObject
Address that receives the interface pointer. If an error occurs, a NULL pointer is placed in this address.

The toolbar's IDropTarget is used by the toolbar when objects are dragged over or dropped onto it.

Version 4.71

TB_GETPADDING

TB_GETPADDING
    wParam = 0;
    lParam = 0;

Retrieves the padding for a toolbar control.

Version 4.71

See also TB_SETPADDING

TB_GETRECT

TB_GETRECT
    wParam = (WPARAM)(INT) iID;
    lParam = (LPARAM)(LPRECT) lprc;

Retrieves the bounding rectangle for a specified toolbar button.

iID
Button identifier.
lprc
Address of a RECT structure that will receive the bounding rectangle information.

Version 4.70.

TB_GETROWS

TB_GETROWS 
    wParam = 0; 
    lParam = 0; 

Retrieves the number of rows of buttons in a toolbar with the TBSTYLE_WRAPABLE style.

TB_GETSTATE

TB_GETSTATE 
    wParam = (WPARAM) idButton; 
    lParam = 0; 

Retrieves information about the state of the specified button in a toolbar, such as whether it is enabled, pressed, or checked.

idButton
Command identifier of the button for which to retrieve information.

TB_GETSTYLE

TB_GETSTYLE
    wParam = 0;
    lParam = 0;

Retrieves the styles currently in use for a toolbar control.

Version 4.70.

TB_GETTEXTROWS

TB_GETTEXTROWS
    wParam = 0;
    lParam = 0;

Retrieves the maximum number of text rows that can be displayed on a toolbar button.

Version 4.70.

See also TB_SETMAXTEXTROWS

TB_GETTOOLTIPS

TB_GETTOOLTIPS 
    wParam = 0; 
    lParam = 0; 

Retrieves the handle to the tooltip control, if any, associated with the toolbar.

TB_GETUNICODEFORMAT

TB_GETUNICODEFORMAT
    wParam = 0;
    lParam = 0;

Retrieves the UNICODE character format flag for the control.

See also TB_SETUNICODEFORMAT

TB_HIDEBUTTON

TB_HIDEBUTTON 
    wParam = (WPARAM) idButton; 
    lParam = (LPARAM) MAKELONG(fShow, 0); 

Hides or shows the specified button in a toolbar.

idButton
Command identifier of the button to hide or show.
fShow
Show flag. If this parameter is TRUE, the button is hidden. If it is FALSE, the button is shown.

TB_HITTEST

TB_HITTEST
    wParam = 0;
    lParam = (LPARAM)(LPPOINT)pptHitTest; 

Determines where a point lies in a toolbar control.

pptHitTest
Address of a point structure that contains the x-coordinate of the hit test in the x member and the y-coordinate of the hit test in the y member. The coordinates are relative to the toolbar's client area.

TB_INDETERMINATE

TB_INDETERMINATE 
    wParam = (WPARAM) idButton; 
    lParam = (LPARAM) MAKELONG(fIndeterminate, 0); 

Sets or clears the indeterminate state of the specified button in a toolbar.

idButton
Command identifier of the button whose indeterminate state is to be set or cleared.
fIndeterminate
Indeterminate flag. If this parameter is TRUE, the indeterminate state is set. If it is FALSE, the state is cleared.

TB_INSERTBUTTON

TB_INSERTBUTTON 
    wParam = (WPARAM) iButton; 
    lParam = (LPARAM) (LPTBBUTTON) lpButton; 

Inserts a button in a toolbar.

iButton
Zero-based index of a button. The message inserts the new button to the left of this button.
lpButton
Address of a TBBUTTON structure containing information about the button to insert.

TB_INSERTMARKHITTEST

TB_INSERTMARKHITTEST
    wParam = (WPARAM)(LPPOINT)lppt;
    lParam = (LPARAM)(LPTBINSERTMARK)lptbim;

Retrieves the insertion mark information for a point in a toolbar.

lppt
Address of a POINT structure that contains the hit test coordinates, relative to the client area of the toolbar.
lptbim
Address of a TBINSERTMARK structure that receives the insertion mark information.

Version 4.71

TB_ISBUTTONCHECKED

TB_ISBUTTONCHECKED 
    wParam = (WPARAM) idButton; 
    lParam = 0;	 

Determines whether the specified button in a toolbar is checked.

idButton
Command identifier of the button.

TB_ISBUTTONENABLED

TB_ISBUTTONENABLED 
    wParam = (WPARAM) idButton; 
    lParam = 0; 

Determines whether the specified button in a toolbar is enabled.

idButton
Command identifier of the button.

TB_ISBUTTONHIDDEN

TB_ISBUTTONHIDDEN 
    wParam = (WPARAM) idButton; 
    lParam = 0; 

Determines whether the specified button in a toolbar is hidden.

idButton
Command identifier of the button.

TB_ISBUTTONHIGHLIGHTED

TB_ISBUTTONHIGHLIGHTED
    wParam = (WPARAM) idButton;
    lParam = 0;

Checks the highlight state of a toolbar button.

idButton
Command identifier for a toolbar button.

Version 4.71

TB_ISBUTTONINDETERMINATE

TB_ISBUTTONINDETERMINATE 
    wParam = (WPARAM) idButton; 
    lParam = 0; 

Determines whether the specified button in a toolbar is indeterminate.

idButton
Command identifier of the button.

TB_ISBUTTONPRESSED

TB_ISBUTTONPRESSED 
    wParam = (WPARAM) idButton; 
    lParam = 0; 

Determines whether the specified button in a toolbar is pressed.

idButton
Command identifier of the button.

TB_LOADIMAGES

TB_LOADIMAGES
    wParam = (WPARAM)(INT) iBitmapID;
    lParam = (LPARAM)(HINSTANCE) hinst;

Loads bitmaps into a toolbar control's image list.

iBitmapID
Identifier of a bitmap that contains the images to be loaded. If hinst is HINST_COMMCTRL, this parameter specifies a set of standard toolbar button bitmaps, shown in the following list. Otherwise, this parameter must be the identifier of a bitmap resource that will be added to the image list as a single image.
Bitmap ID Description
IDB_HIST_LARGE_COLOR Explorer bitmaps in large size.
IDB_HIST_SMALL_COLOR Explorer bitmaps in small size.
IDB_STD_LARGE_COLOR Standard bitmaps in large size.
IDB_STD_SMALL_COLOR Standard bitmaps in small size.
IDB_VIEW_LARGE_COLOR View bitmaps in large size.
IDB_VIEW_SMALL_COLOR View bitmaps in small size.
hinst
Program instance handle to the calling application. This parameter can be HINST_COMMCTRL to load a standard image list.

If your application specifies HINST_COMMCTRL, then you must use the proper image index values when you prepare TBBUTTON structures prior to sending the TB_ADDBUTTONS message. For a list of image index values for these preset bitmaps, see Toolbar Standard Button Image Index Values.

Version 4.70

TB_MAPACCELERATOR

TB_MAPACCELERATOR
    wParam = (WPARAM)(TCHAR) chAccel;
    lParam = (LPARAM)(LPUINT) pIDBtn;

Maps an accelerator character to a toolbar button.

chAccel
Accelerator character to be mapped. This character is the same character that is underlined in the button's text.
pIDBtn
Address of a UINT that receives the command identifier of the button that corresponds to the accelerator specified in cchAccel.

Version 4.71

TB_MARKBUTTON

TB_MARKBUTTON
    wParam = (WPARAM) idButton;
    lParam = (LPARAM) MAKELONG(fHighlight,0);

Sets the highlight state of a given button in a toolbar control.

idButton
Command identifier for a toolbar button.
fHighlight
Value that specifies the highlight state to be set. If this value is TRUE, the button is highlighted. If it's FALSE, the button is set to its default state.

Version 4.71

TB_MOVEBUTTON

TB_MOVEBUTTON
    wParam = (WPARAM)(UINT)uOldPos;
    lParam = (LPARAM)(UINT)uNewPos;

Moves a button from one index to another.

uOldPos
Zero-based index of the button to be moved.
uNewPos
Zero-based index where the button will be moved.

Version 4.71

See also TB_SETANCHORHIGHLIGHT

TB_PRESSBUTTON

TB_PRESSBUTTON 
    wParam = (WPARAM) idButton; 
    lParam = (LPARAM) MAKELONG(fPress, 0); 

Presses or releases the specified button in a toolbar.

idButton
Command identifier of the button to press or release.
fPress
Press flag. If this parameter is TRUE, the button is pressed. If it is FALSE, the button is released.

TB_REPLACEBITMAP

TB_REPLACEBITMAP
    wParam = 0;
    lParam = (LPARAM) (LPTBREPLACEBITMAP) ptbrb;

Replaces an existing bitmap with a new bitmap.

ptbrb
Address of a TBREPLACEBITMAP structure that contains the information of the bitmap to be replaced and the new bitmap.

TB_SAVERESTORE

TB_SAVERESTORE 
    wParam = (WPARAM) (BOOL) fSave; 
    lParam = (LPARAM)  (TBSAVEPARAMS *)ptbsp; 

Saves or restores the state of the toolbar.

fSave
Save or restore flag. If this parameter is TRUE, the information is saved. If it is FALSE, it is restored.
ptbsp
Address of a TBSAVEPARAMS structure that specifies the registry key, subkey, and value name for the toolbar state information.

To save and restore a toolbar's settings using the TB_SAVERESTORE message, the parent window of the toolbar control must implement a handler for the TBN_GETBUTTONINFO notification message. The toolbar uses this notification to retrieve information about the buttons as they are read out of the registry.

TB_SETANCHORHIGHLIGHT

TB_SETANCHORHIGHLIGHT
    wParam = (WPARAM)(BOOL) fAnchor;
    lParam = 0;

Sets the anchor highlight setting for a toolbar.

fAnchor
Boolean value that specifies if anchor highlighting is enabled or disabled. If this value is nonzero, anchor highlighting will be enabled. If this value is zero, anchor highlighting will be disabled.

Anchor highlighting in a toolbar means that the last highlighted item will remain highlighted until another item is highlighted. This occurs even if the cursor leaves the toolbar control.

Version 4.71

TB_SETBITMAPSIZE

TB_SETBITMAPSIZE 
    wParam = 0; 
    lParam = (LPARAM) MAKELONG(dxBitmap, dyBitmap) 

Sets the size of the bitmapped images to be added to a toolbar.

dxBitmap
Width, in pixels, of the bitmapped images.
dyBitmap
Height, in pixels, of the bitmapped images.

The size can be set only before adding any bitmaps to the toolbar. If an application does not explicitly set the bitmap size, the size defaults to 16 by 15 pixels.

TB_SETBUTTONINFO

TB_SETBUTTONINFO
    wParam = (WPARAM)(INT) iID;
    lParam = (LPARAM)(LPTBBUTTONINFO) lptbbi;

Sets the information for an existing button in a toolbar.

iID
Button identifier.
lptbbi
Address of a TBBUTTONINFO structure that contains the new button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.

Version 4.71

TB_SETBUTTONSIZE

TB_SETBUTTONSIZE 
    wParam = 0; 
    lParam = (LPARAM) MAKELONG(dxButton, dyButton) 

Sets the size of the buttons to be added to a toolbar.

dxButton
Width, in pixels, of the buttons.
dyButton
Height, in pixels, of the buttons.

The size can be set only before adding any buttons to the toolbar. If an application does not explicitly set the button size, the size defaults to 24 by 22 pixels.

TB_SETBUTTONWIDTH

TB_SETBUTTONWIDTH
    wParam = 0;
    lParam = (LPARAM)(DWORD) MAKELONG(cxMin,cxMax);

Sets the minimum and maximum button widths in the toolbar control.

cxMin
Minimum button width, in pixels. Toolbar buttons will never be narrower than this value.
cxMax
Maximum button width, in pixels. If button text is too wide, the control displays it with ellipsis points.

Version 4.70

TB_SETCMDID

TB_SETCMDID 
    wParam = (WPARAM) (UINT) index; 
    lParam = (WPARAM) (UINT) cmdId; 

Sets the command identifier of a toolbar button.

index
Zero-based index of the button whose command identifier is to be set.
cmdId
Command identifier.

TB_SETCOLORSCHEME

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

Sets the color scheme information for the toolbar control.

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

The toolbar control uses the color scheme information when drawing the 3-D elements in the control.

Version 4.71

See also TB_GETCOLORSCHEME

TB_SETDISABLEDIMAGELIST

TB_SETDISABLEDIMAGELIST
    wParam = 0;
    lParam = (LPARAM)(HIMAGELIST) himlNewDisabled;

Sets the image list that the toolbar control will use to display disabled buttons.

himlNewDisabled
Handle to the image list that will be set.

Version 4.70

TB_SETDRAWTEXTFLAGS

TB_SETDRAWTEXTFLAGS
    wParam = (WPARAM)(DWORD) dwMask;
    lParam = (LPARAM)(DWORD) dwDTFlags;

Sets the text drawing flags for the toolbar.

dwMask
One or more of the DT_ flags, specified in DrawText, that indicate which bits in dwDTFlags will be used when drawing the text.
dwDTFlags
One or more of the DT_ flags, specified in DrawText, that indicate how the button text will be drawn. This value will be passed to the DrawText API when the button text is drawn.

The dwMask parameter allows you to specify which flags will be used when drawing the text, even if these flags are turned off. For example, if you don't want the DT_CENTER flag used when drawing text, you would add the DT_CENTER flag to dwMask and not specify the DT_CENTER flag in dwDTFlags. This prevents the control from passing the DT_CENTER flag to the DrawText API.

Version 4.71

TB_SETEXTENDEDSTYLE

TB_SETEXTENDEDSTYLE
    wParam = 0;
    lParam = (LPARAM)(DWORD)dwExStyle;

Sets the extended styles for a toolbar control.

dwExStyle
Value specifying the new extended styles. This parameter can be a combination of extended styles.

Version 4.71

See also TB_GETEXTENDEDSTYLE

TB_SETHOTIMAGELIST

TB_SETHOTIMAGELIST
    wParam = 0;
    lParam = (LPARAM)(HIMAGELIST) himlNewHot;

Sets the image list that the toolbar control will use to display hot buttons. A button is hot when the pointer is above it. Toolbar controls that do not have the TBSTYLE_FLAT style do not have hot items.

himlNewHot
Handle to the image list that will be set.

Version 4.70.

TB_SETHOTITEM

TB_SETHOTITEM
    wParam = (WPARAM)(INT)iHot;
    lParam = 0;

Sets the hot item in a toolbar. This message is ignored for toolbar controls that do not have the TBSTYLE_FLAT style.

iHot
Index of the item that will be made hot. If this value is -1, none of the items will be hot.

Version 4.71

TB_SETIMAGELIST

TB_SETIMAGELIST
    wParam = 0;
    lParam = (LPARAM)(HIMAGELIST) himlNew;

Sets the image list that the toolbar will use to display buttons that are in their default state.

himlNew
Handle to the image list that will be set. If this parameter is NULL, no images will be displayed in the buttons.

A toolbar control uses himlNew to display buttons in their default state, which is when they are not hot or disabled.

Version 4.70

TB_SETINDENT

TB_SETINDENT
    wParam = (WPARAM)(INT) iIndent;
    lParam = 0;

Sets the indentation for the first button in a toolbar control.

iIndent
Value specifying the indentation, in pixels.

Version 4.70

TB_SETINSERTMARK

TB_SETINSERTMARK
    wParam = 0;
    lParam = (LPARAM)(LPTBINSERTMARK)lptbim;

Sets the current insertion mark for the toolbar.

lptbim
Address of a TBINSERTMARK structure that contains the insertion mark.

Version 4.71

See also TB_GETINSERTMARK

TB_SETINSERTMARKCOLOR

TB_SETINSERTMARKCOLOR
    wParam = 0;
    lParam = (LPARAM)(COLORREF)clrInsertMark;

Sets the color used to draw the insertion mark for the toolbar.

clrInsertMark
COLORREF value that contains the new insertion mark color.

Version 4.71

See also TB_GETINSERTMARKCOLOR

TB_SETMAXTEXTROWS

TB_SETMAXTEXTROWS
    wParam = (WPARAM)(INT) iMaxRows;
    lParam = 0;

Sets the maximum number of text rows displayed on a toolbar button.

iMaxRows
Specifies the maximum number of rows of text that can be displayed.

Version 4.70

TB_SETPADDING

TB_SETPADDING
    wParam = 0;
    lParam = MAKELPARAM(cx, cy);

Sets the padding for a toolbar control.

cx
The horizontal padding, in pixels.
cy
The vertical padding, in pixels.

The padding values are used to create a blank area between the edge of the button and the button's image and/or text. The horizontal padding value is applied to both the right and left of the button, and the vertical padding value is applied to both the top and bottom of the button. Padding is only applied to buttons that have the TBSTYLE_AUTOSIZE style.

Version 4.71

See also TB_GETPADDING

TB_SETPARENT

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

Sets the window to which the toolbar control sends notification messages.

hwndParent
Handle to the window to receive notification messages.

The TB_SETPARENT message does not change the parent window that was specified when the control was created. Calling the GetParent function for a toolbar control will return the actual parent window, not the window specified in TB_SETPARENT. To change the control's parent window, call the SetParent function.

TB_SETROWS

TB_SETROWS 
    wParam = (WPARAM) MAKEWPARAM(cRows, fLarger); 
    lParam = (LPARAM) (LPRECT) lprc; 

Sets the number of rows of buttons in a toolbar.

cRows
Number of rows requested. The minimum number of rows is one, and the maximum number of rows is equal to the number of buttons in the toolbar.
fLarger
Flag that indicates whether to create more rows than requested when the system cannot create the number of rows specified by cRows. If this parameter is TRUE, the system creates more rows. If it is FALSE, the system creates fewer rows.
lprc
Address of a RECT structure that receives the bounding rectangle of the toolbar after the rows are set.

Because the system does not break up button groups when setting the number of rows, the resulting number of rows might differ from the number requested.

TB_SETSTATE

TB_SETSTATE 
    wParam = (WPARAM) idButton; 
    lParam = (LPARAM) MAKELONG(fState, 0); 

Sets the state for the specified button in a toolbar.

idButton
Command identifier of the button.
fState
State flags. This parameter can be a combination of the values listed in Toolbar Button States.

TB_SETSTYLE

TB_SETSTYLE
    wParam = 0;
    lParam = (LPARAM)(DWORD) dwStyle;

Sets the style for a toolbar control.

dwStyle
Value specifying the styles to be set for the control. This value can be a combination of toolbar control styles.

Version 4.70

TB_SETTOOLTIPS

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

Associates a tooltip control with a toolbar.

hwndToolTip
Handle to the tooltip control.

Any buttons added to a toolbar before sending the TB_SETTOOLTIPS message will not be registered with the tooltip control.

TB_SETUNICODEFORMAT

TB_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 TB_GETUNICODEFORMAT

Toolbar Control Notification Messages

This section contains information about the notification messages sent by toolbar controls.

NM_CHAR (toolbar)

NM_CHAR
    lpnmc = (LPNMCHAR) lParam;

Sent by the toolbar when a character key is processed. This notification message is sent in the form of a WM_NOTIFY message.

lpnmc
Address of an NMCHAR structure that contains additional information about the character that caused the notification message. The dwItemPrev member of this structure contains the command identifier of the item that is currently hot or -1 if no item is currently hot. The dwItemNext member of this structure contains the command identifier of the item that will become hot or -1 if the key does not match any item's accelerator.

Version 4.71

NM_CUSTOMDRAW (toolbar)

NM_CUSTOMDRAW
    lpNMCustomDraw = (LPNMTBCUSTOMDRAW) lParam;

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

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

Version 4.71. Address of an NMTBCUSTOMDRAW structure that contains information about the drawing operation.

Version 4.70

See also Using Custom Draw

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