L_TBGetButtonInfo

#include "ltTLB.h"

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

Gets the information for the specified toolbar button.

Parameters

const pTOOLBARHANDLE pToolbar

Pointer to a toolbar handle.

L_UINT uButtonId

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

pLBUTTONINFO pButtonInfo

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

L_UINT uStructSize

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

Returns

Value Meaning
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

See Also

Functions

Topics

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

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Toolbar C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.