GBM_SETGRAPHICDATA
Appearance
An application sends this message to change the graphical data of the graphic button. This data includes the text and bit maps.
Syntax
param1
P[[GBTNCDATA]] [[gbtncdata]] /* New graphic button data to use. */
param2
[[ULONG]] [[ulReserved]] /* Reserved. */
Parameters
- gbtncdata (PGBTNCDATA)
- New graphic button data to use.
- ulReserved (ULONG)
- Reserved.
Return Value
- rc (ULONG)
- Return code indicating success or failure.
- TRUE: Success.
- FALSE: Failure or not recognized.
Remarks
Setting the graphic button data with this message erases all previous data related to the state of the graphic button. The state of the graphic button will be set to the default parameters.
WinSetWindowText can be used to change the text of the graphic button without altering the button's parameters or state.
Example Code
The following code illustrates how to change graphical data for a graphic button.
typedef struct {
USHORT usReserved; /*Reserved field */
PSZ pszText; /*Initial text of button */
HMODULE hmod; /*Module handle for bit maps */
USHORT cBitmaps; /*Number of bit maps */
USHORT aidBitmap[1]; /*Array of bit-map IDs */
} GBTNCDATA;
typedef GBTNCDATA *PGBTNCDATA;
GBTNCDATA cdata;
cdata.usReserved = GB_STRUCTURE;
cdata.pszText = 'Play';
cdata.hmod = hmodBitmaps;
cdata.cBitmaps = 1;
cdata.aidBitmap[0] = ID_PLAY;
WinSendMsg ( hwndButton, GBM_SETGRAPHICDATA, (MPARAM)&cdata, 0L);