L_ILM_IMPORTBITMAPLIST
Send this message to insert a list of bitmaps into the ImageList Control.
Parameter |
Description |
wParam |
Ignored, use 0. |
lParam |
Pointer to the LILIMPORTBITMAPLIST structure that contains the list of bitmaps to be inserted. |
Returns
SUCCESS |
Function was successful. |
<0 |
An error occurred. Refer to Error Codes. |
Comments
You must set the uStructSize member of the LILIMPORTBITMAPLIST structure before using this message.
The list of bitmaps found in the passed LILIMPORTBITMAPLIST structure (pointed to by lParam) will be inserted into the Image List control starting from nStartIndex to (nStartIndex + nItemsToInsert –1).
After inserting the list of bitmaps successfully into the ImageList control, don’t try to free the bitmaps of the passed list (hList’s bitmaps). The ImageList control will have a reference to hList bitmaps not a copy of them.
The associated macro is:
L_ImgListImportBitmapList(hWnd, pImportList)
For a complete list of available macros, refer to the Ltlst.h file.
See Also
Elements: |
L_ILM_EXPORTBITMAPLIST, L_ILM_GETITEMOPTIONS, L_ILM_SETITEMOPTIONS |
Topics: |
|
|
Example
L_VOID TestImportList(HWND hWnd, HBITMAPLIST hList)
{
if(IsWindow(hWnd) && hList)
{
L_UINT uCount =0;
// Getting the number of bitmaps in the list.
L_GetBitmapListCount(hList, &uCount);
if(uCount > 0) // There are some bitmaps
{
LILIMPORTBITMAPLIST ImportList;
ZeroMemory(&ImportList, sizeof(LILIMPORTBITMAPLIST));
ImportList.uStructSize = sizeof(LILIMPORTBITMAPLIST);
ImportList.hList = hList;
ImportList.nStartIndex = 0; // Start from Index 0.
ImportList.nItemsToInsert = uCount;// Import all the list bitmaps.
ImportList.pText = _T("Imported Bitmap-Text");
ImportList.pTextExt = _T("Imported Bitmap-TextExt");
SendMessage(hWnd, L_ILM_IMPORTBITMAPLIST, (WPARAM)0, (LPARAM)(&ImportList));
/* update the control */
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
}
}
}