L_TBSetButtonInfo

#include "ltTLB.h"

L_INT EXT_FUNCTION L_TBSetButtonInfo( pToolbar, uButtonId, pButtonInfo )

pTOOLBARHANDLE pToolbar;

/* pointer to a handle */

L_UINT uButtonId;

/* button Id */

const pLBUTTONINFO pButtonInfo;

/* pointer to a structure */

Sets the information for the specified toolbar button.

Parameter

Description

pToolbar

Pointer to a toolbar handle.

uButtonId

Identifier that indicates the button for which to set the specified information.

pButtonInfo

Pointer to LBUTTONINFO structure that contains the button information to set.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

Comments

To get the current information for a toolbar button calls L_TBGetButtonInfo.

Required DLLs and Libraries

LTTLB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_TBAddButton, L_TBRemoveButton, L_TBGetButtonInfo, L_TBGetToolbarInfo, L_TBSetToolbarInfo.

Topics:

Getting and Setting Toolbar Button Information

Example

/*This example will change the bitmap image of the given toolbar button. */

L_VOID SetButtonBitmap( pTOOLBARHANDLE pToolbar, L_UINT uButtonId, HBITMAP hBitmap )
{
   LBUTTONINFO ButtonInfo;
   
   /* get button info */
   ButtonInfo.uStructSize = sizeof( LBUTTONINFO );
   L_TBGetButtonInfo ( pToolbar, uButtonId, &ButtonInfo, sizeof(LBUTTONINFO) );

   /* set new bitmap image */
   ButtonInfo.hBitmap = hBitmap;

   /* set new button info */
   L_TBSetButtonInfo( pToolbar, uButtonId, &ButtonInfo );
}