L_TBGetButtonInfo

Summary

Gets the information for the specified toolbar button.

Syntax

#include "ltTLB.h"

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

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 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Toolbar C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.