L_ILM_GETITEM

Send this message to get the specified item from the ImageList Control.

Parameter

Description

wParam

0-based index of the item to get.

lParam

Pointer to LILITEM structure to be filled with the item.

 

Returns

SUCCESS

Function was successful

< 0

An error occurred. Refer to Return Codes.

Comments

The LILITEM structure pointed to by lParam specifies the information to retrieve and will be filled with the information about the item. The uMask member of the LILITEM structure indicates the attributes of the item to retrieve.

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

If you are including the LILITEM_BITMAP flag in the uMask member of the LILITEM structure, you must set the uBitmapStructSize member of the LILITEM structure before using this message.

The associated macro is:

L_ImgListGetItem(hWnd, uIndex, pItem)

After this function returns, the LILITEM structure pointed to by lParam will reference the specified item. You can use the pBitmap or pText members of the structure to modify the item. If you modify the bitmap or text pointed to by this structure, you will be directly modifying the item in the ImageList Control. You should not attempt to free the memory pointed to by pBitmap or pText.

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

See Also

Elements:

L_ILM_GETITEMCOUNT, L_ILM_SETITEM, L_ILM_GETSELCOUNT, L_ILM_GETSELITEMS

Topics:

Using the ImageList Control

 

Image List Control Messages

Example

L_VOID TestFunc10(HWND hWnd)
{
   LILITEM Item;
   LRESULT lRet;

   if(IsWindow(hWnd))
   {
      /* get the 3rd item */
      memset(&Item, 0, sizeof(LILITEM));
      Item.uStructSize = sizeof(LILITEM);
      Item.uMask = LILITEM_BITMAP|LILITEM_TEXT; /* retrieve the bitmap & the text */
      lRet = SendMessage(hWnd, L_ILM_GETITEM, 2, (LPARAM)&Item);
      if((L_INT)lRet==SUCCESS)
      {
         MessageBox(hWnd, Item.pText, TEXT("Item"), MB_OK);
         /* flip the image and update the control */
         L_FlipBitmap(Item.pBitmap);
         RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | 
RDW_ERASE);
      }
   }
}