L_TBSetButtonInfo

Summary

Sets the information for the specified toolbar button.

Syntax

#include "ltTLB.h"

L_LTTLB_API L_INT L_TBSetButtonInfo( pToolbar, uButtonId, pButtonInfo)

Parameters

pTOOLBARHANDLE pToolbar

Pointer to a toolbar handle.

L_UINT uButtonId

Identifier that indicates the button for which to set the specified information.

const pLBUTTONINFO pButtonInfo

Pointer to an LBUTTONINFO structure that contains the button information to set.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes

Comments

To get the current information for a toolbar button, call L_TBGetButtonInfo.

Required DLLs and Libraries

See Also

Functions

Topics

Example

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

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 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.