L_TBGetButtonInfo

#include "ltTLB.h"

L_LTTLB_API L_INT L_TBGetButtonInfo( pToolbar, uButtonId, pButtonInfo, uStructSize)

const pTOOLBARHANDLE pToolbar;

/* pointer to a handle */

L_UINT uButtonId;

/* button Id */

pLBUTTONINFO pButtonInfo;

/* pointer to a structure */

L_UINT uStructSize;

/* size in bytes, of the structure pointed to by pButtonInfo */

Gets the information for the specified toolbar button.

Parameter

Description

pToolbar

Pointer to a toolbar handle.

uButtonId

Identifier that indicates the button for which to get the information.

pButtonInfo

Pointer to LBUTTONINFO structure to be updated with the button information.

uStructSize

Size in bytes, of the structure pointed to by pButtonInfo, for versioning. Use sizeof(LBUTTONINFO).

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

Comments

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.

See Also

Functions:

L_TBAddButton, L_TBRemoveButton, L_TBSetButtonInfo, L_TBGetToolbarInfo, L_TBSetToolbarInfo.

Topics:

Getting and Setting Toolbar Button Information

Example

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;
}