Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Controls
Control Library
Toolbar
Messages
 TB_SETBUTTONINFO Message
TB_SETBUTTONINFO Message

Sets the information for an existing button in a toolbar.

Syntax

To send this message, call the SendMessage function as follows.

lResult = SendMessage(     // returns LRESULT in lResult
   (HWND) hWndControl,     // handle to destination control
   (UINT) TB_SETBUTTONINFO,     // message ID
   (WPARAM) wParam,     // = (WPARAM) (INT) iID;
   (LPARAM) lParam     // = (LPARAM) (LPTBBUTTONINFO) lptbbi;
);

Parameters

iID
Button identifier.
lptbbi
Pointer to 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.

Return Value

Returns nonzero if successful, or zero otherwise.


Remarks

Text is commonly assigned to buttons when they are added to a toolbar by specifying the index of a string in the toolbar's string pool. If you use a TB_SETBUTTONINFO to assign new text to a button, it will permanently override the text from the string pool. You can change the text by calling TB_SETBUTTONINFO again, but you cannot reassign the string from the string pool.

Message Information

Minimum DLL Versioncomctl32.dll version 4.71 or later
Headercommctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0

See Also

TB_ADDBUTTONS, TB_GETBUTTONINFO, TB_GETBUTTONTEXT, TB_GETSTRING, TB_INSERTBUTTON
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker