L_ILM_INSERTAT

Send this message to insert an item into the ImageList Control at a specified index.

Parameters

wParam

Index at which to insert the item.

lParam

Pointer to LILITEM structure containing item to be inserted

Returns

Value Meaning
SUCCESS Function was successful
< 0 An error occurred. Refer to Return Codes.

Comments

This message will insert the specified item at the specified index in the list. All items from the specified index are pushed up by one.

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:

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

See Also

Elements

Topics

Example

L_INT ILM_INSERTATExample(HWND hCtrl) 
{ 
   if(IsWindow(hCtrl)) 
   { 
      LILITEM Item; 
      L_TCHAR szText[200]; 
      SYSTEMTIME st; 
      BITMAPHANDLE Bitmap; 
      L_INT nRet; 
 
      nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("image1.cmp")), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL); 
      if(nRet == SUCCESS) 
      { 
         ZeroMemory(&Item, sizeof(LILITEM)); 
         Item.uStructSize = sizeof(LILITEM); 
         Item.pBitmap   = &Bitmap; 
         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); 
         /* insert item at the specified index */ 
         nRet = (L_INT)SendMessage(hCtrl, L_ILM_INSERTAT, 3, (LPARAM)&Item); 
         SendMessage(hCtrl, L_ILM_ENSUREVISIBLE, 3, 0L); 
 
         L_FreeBitmap(&Bitmap); 
      } 
      return nRet; 
   } 
   else 
      return ERROR_INVALID_PARAMETER; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.