Help Center

CToolbar.GetButtonInfomethod

Retrieves extended information for a button in a toolbar.

WindowsmethodCToolbar.incdocumented

Syntax

FUNCTION GetButtonInfo (BYVAL hToolbar AS HWND, BYVAL iID AS LONG, BYVAL ptbbi AS TBBUTTONINFOW PTR) AS LONG
FUNCTION GetButtonInfo (BYVAL hToolbar AS HWND, BYVAL iID AS LONG, BYREF tbbi AS TBBUTTONINFOW) AS LONG
FUNCTION GetButtonInfo (BYVAL hToolbar AS HWND, BYVAL iID AS LONG) AS TBBUTTONINFOW

Parameters

NameDescription
hToolbarHandle to the toolbar control.
iIDCommand identifier of the button.
ptbbiPointer to a TBBUTTONINFOW structure that receives the button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
tbbiA TBBUTTONINFOW structure that receives the button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.

Return value

Returns the zero-based index of the button, or -1 if an error occurs.

Description

Retrieves extended information for a button in a toolbar.

Remarks

When you use TB_ADDBUTTONSW or TB_INSERTBUTTONW to place buttons on the toolbar, the button text is commonly specified by its string pool index. TB_GETBUTTONINFOW will not retrieve this string. To use TB_GETBUTTONINFOW to retrieve button text, you must first set the text string with TB_SETBUTTONINFOW. Once you have set the button text with TB_SETBUTTONINFOW, you can no longer use the string pool index.

Reference

  • Include file CToolbar.inc
  • Defined in AfxNova/CToolbar.inc:490
  • Documented in Windows/WIndows Controls/CToolbar Class.md
  • Topic: CToolbar Class