Sets the information for the specified toolbar button.
#include "ltTLB.h"
L_LTTLB_API L_INT L_TBSetButtonInfo( pToolbar, uButtonId, pButtonInfo)
Pointer to a toolbar handle.
Identifier that indicates the button for which to set the specified information.
Pointer to an LBUTTONINFO structure that contains the button information to set.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes |
To get the current information for a toolbar button, call L_TBGetButtonInfo.
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.
This example will change the bitmap image of the given toolbar button.
L_INT TBSetButtonInfoExample( pTOOLBARHANDLE pToolbar,
L_UINT uButtonId,
HBITMAP hBitmap )
{
L_INT nRet;
LBUTTONINFO ButtonInfo;
/* get button info */
ZeroMemory(&ButtonInfo, sizeof(LBUTTONINFO) );
nRet = L_TBGetButtonInfo ( pToolbar, uButtonId, &ButtonInfo, sizeof(LBUTTONINFO) );
if(nRet != SUCCESS)
return nRet;
/* free the old bitmap image */
DeleteObject(ButtonInfo.hBitmap);
/* set new bitmap image */
ButtonInfo.hBitmap = hBitmap;
/* set new button info */
nRet = L_TBSetButtonInfo( pToolbar, uButtonId, &ButtonInfo );
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}