#include "ltTLB.h"
L_LTTLB_API L_INT L_TBGetButtonInfo( pToolbar, uButtonId, pButtonInfo, uStructSize)
Gets the information for the specified toolbar button.
Pointer to a toolbar handle.
Identifier that indicates the button for which to get the information.
Pointer to an LBUTTONINFO structure to be updated with the button information.
Size in bytes of the structure pointed to by pButtonInfo, for versioning. Use sizeof(LBUTTONINFO).
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes |
To change the information on the specified toolbar button, call this function to get the current information. Change the information in pButtonInfo and then call L_TBSetButtonInfo.
When the toolbar button bitmap is no longer needed, you must free it using the Windows API function DeleteObject.
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.
This example returns a copy of the given button's bitmap image.
HBITMAP TBGetButtonInfoExample( pTOOLBARHANDLE pToolbar, L_UINT uButtonId,L_INT *nRet )
{
LBUTTONINFO ButtonInfo;
HBITMAP hBitmap;
/* get button info */
ZeroMemory( &ButtonInfo, sizeof(LBUTTONINFO) );
*nRet = L_TBGetButtonInfo( pToolbar, uButtonId, &ButtonInfo, sizeof(LBUTTONINFO) );
/* create a copy of the bitmap image */
hBitmap = (HBITMAP) CopyImage( ButtonInfo.hBitmap, IMAGE_BITMAP, 0, 0, 0 );
/* free the original so we don't leak */
DeleteObject( ButtonInfo.hBitmap );
return hBitmap;
}