TB_LOADIMAGES Message

Loads system-defined button images into a toolbar control's image list.

Syntax

To send this message, call the SendMessage function as follows.
lResult = SendMessage(    // returns LRESULT in lResult
   hWndControl,           // (HWND) handle to destination control
   TB_LOADIMAGES,         // (UINT) message ID
   wParam,                // = (WPARAM)(INT) iBitmapID; 
   lParam                 // = (LPARAM)(HINSTANCE) hinst;
);

Parameters

iBitmapID
Identifier of a system-defined button image list. This parameter can be set to one of the following values.

IDB_HIST_LARGE_COLOR
Windows Explorer bitmaps in large size.
IDB_HIST_SMALL_COLOR
Windows Explorer bitmaps in small size.
IDB_STD_LARGE_COLOR
Standard bitmaps in large size.
IDB_STD_SMALL_COLOR
Standard bitmaps in small size.
IDB_VIEW_LARGE_COLOR
View bitmaps in large size.
IDB_VIEW_SMALL_COLOR
View bitmaps in small size.
IDB_HIST_NORMAL
Windows Explorer travel buttons and favorites bitmaps in normal state.
IDB_HIST_HOT
Windows Explorer travel buttons and favorites bitmaps in hot state.
IDB_HIST_DISABLED
Windows Explorer travel buttons and favorites bitmaps in disabled state.
IDB_HIST_PRESSED
Windows Explorer travel buttons and favorites bitmaps in pressed state.
hinst
Instance handle. This parameter must be set to HINST_COMMCTRL.

Return Value

The count of images in the image list. Returns zero if the toolbar has no image list or if the existing image list is empty.

Remarks

You must use the proper image index values when you prepare TBBUTTON structures prior to sending the TB_ADDBUTTONS message. For a list of image index values for these preset bitmaps, see Toolbar Standard Button Image Index Values.

Example

The following sample code loads the system standard small color images.

// hWndToobar is the window handle of the toolbar control.
SendMessage(hWndToolbar, TB_LOADIMAGES, (WPARAM)IDB_STD_SMALL_COLOR, (LPARAM)HINST_COMMCTRL);

Message Information

Minimum DLL Versioncomctl32.dll version 4.70 or later
Headercommctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0

See Also

TB_ADDBITMAP
Tags :


Page view tracker