Send this message to update the specified item in the ImageList Control.
0-based index of the item to update.
Pointer to an LILITEM structure that contains new attributes for the item.
Value | Meaning |
---|---|
SUCCESS | Function was successful |
< 0 | An error occurred. Refer to Return Codes. |
The LILITEM structure pointed to by lParam specifies the information to update the specified item with. The uMask member of the LILITEM structure indicates the attributes of the item to update.
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.
Note: when you update an item, 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.
L_INT ILM_SETITEMExample(HWND hCtrl)
{
if(IsWindow(hCtrl))
{
LILITEM Item;
L_TCHAR szText[200];
SYSTEMTIME st;
BITMAPHANDLE Bitmap;
L_INT nRet;
/* load new image for the item */
ZeroMemory(&Item, sizeof(LILITEM));
nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("image1.cmp")), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
if(nRet == SUCCESS)
{
Item.uStructSize = sizeof(LILITEM);
Item.pBitmap = &Bitmap;
Item.uBitmapStructSize = sizeof(BITMAPHANDLE);
Item.pText = szText;
Item.bSelected = TRUE;
Item.lData = 0;
GetSystemTime(&st);
wsprintf(szText, TEXT("%d:%d:%d"),st.wMinute,st.wSecond,st.wMilliseconds);
/* update all attributes */
Item.uMask = LILITEM_BITMAP | LILITEM_TEXT | LILITEM_SELECTED | LILITEM_DATA;
/* update the 3rd item with the new data */
nRet = (L_INT)SendMessage(hCtrl, L_ILM_SETITEM, 2, (LPARAM)&Item);
/* update the control */
RedrawWindow(hCtrl, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
L_FreeBitmap(&Bitmap);
}
return nRet;
}
else
return ERROR_INVALID_PARAMETER;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document