L_ILM_INSERT

Send this message to insert an item into the ImageList Control.

Parameter

Description

wParam

Ignored, use 0.

lParam

Pointer to LILITEM structure containing the item to be inserted.

 

Returns

SUCCESS

Function was successful

< 0

An error occurred. Refer to Return Codes.

Comments

This message will insert the specified item at the end of the list.

You must set the uStructSize member of the LILSELOPTION structure before using this message.

Note: On an insert, the image and text (if any) are copied to internal storage. The ImageList Control will free its copy of the image and/or text when the item is deleted. You are responsible for freeing the original data when it is no longer needed by your application.

The associated macro is:

L_ImgListInsert(hWnd, pItem)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements:

L_ILM_INSERTAT, L_ILM_REMOVE, L_ILM_CLEAR, L_ILM_ENSUREVISIBLE, L_ILM_GETITEMCOUNT, L_ILM_SORT, L_ILM_GETROWCOUNT, L_ILM_GETCOLCOUNT

Topics:

Using the ImageList Control

 

Image List Control Messages

Example

L_VOID TestFunc21(HWND hWnd, pBITMAPHANDLE pBitmap)
{
   LILITEM Item;
   L_TCHAR szText[200];
   SYSTEMTIME st;

   if(IsWindow(hWnd))
   {
      Item.uStructSize = sizeof(LILITEM);
      Item.pBitmap   = pBitmap;
      Item.uBitmapStructSize = sizeof(BITMAPHANDLE);
      Item.pText     = szText;
      Item.bSelected = FALSE;
      Item.lData     = 0;
      GetSystemTime(&st);
      wsprintf(szText, TEXT("%d%d%d"),st.wMinute,st.wSecond,st.wMilliseconds); 
      SendMessage(hCtl, L_ILM_INSERT, 0, (LPARAM)(pLILITEM)&Item);
   }
}