Send this message to draw/paint the specified item in the ImageList Control's parent window.
0-not used.
Pointer to an LILDRAWITEM structure that contains information about the item to be drawn/painted.
Value | Meaning |
---|---|
ERROR_USER_ABORT | The ImageList Control will not do any further drawing/painting of the specified item. |
<> ERROR_USER_ABORT | The ImageList Control will draw/paint the item normally. |
The LILDRAWITEM structure pointed to by lParam specifies the information to draw/paint.
The user is responsible for any objects created during the processing of this message. In addition, the user is also responsible for returning the HDC to its original state before returning from the processing of this message.
this function processes all the messages for a window
L_INT32 MainWndProc8(HWND hWnd, L_UINT Message, WPARAM wParam,LPARAM lParam)
{
pLILDRAWITEM pdi=NULL;
switch (Message)
{
case ILM_DRAWITEM:
pdi=(pLILDRAWITEM)lParam;
if(pdi)
{
if(pdi->pItem)
{
HRGN hRgn1=NULL;
HRGN hRgn2=NULL;
HBRUSH hBrush=NULL;
RECT rcMyItem;
SaveDC(pdi->hDC);
CopyRect(&rcMyItem, &pdi->rcItem);
InflateRect(&rcMyItem, -10, -10);
hRgn1 = CreateEllipticRgn(pdi->rcItemBack.left,
pdi->rcItemBack.top,
pdi->rcItemBack.right,
pdi->rcItemBack.bottom);
hRgn2 = CreateEllipticRgn(rcMyItem.left,
rcMyItem.top,
rcMyItem.right,
rcMyItem.bottom);
if(pdi->pItem->bSelected)
hBrush=(HBRUSH)GetStockObject(WHITE_BRUSH);
else
hBrush=(HBRUSH)GetStockObject(BLACK_BRUSH);
SelectObject(pdi->hDC, hBrush);
SelectObject(pdi->hDC, hRgn1);
Rectangle(pdi->hDC, pdi->rcItemBack.left,
pdi->rcItemBack.top,
pdi->rcItemBack.right,
pdi->rcItemBack.bottom);
SelectObject(pdi->hDC, hRgn2);
L_PaintDC(pdi->hDC, pdi->pItem->pBitmap,
NULL, NULL, &rcMyItem, NULL, SRCCOPY);
if(pdi->pItem->pText && lstrlen(pdi->pItem->pText))
DrawText(pdi->hDC, pdi->pItem->pText,
lstrlen(pdi->pItem->pText), &rcMyItem,
DT_SINGLELINE|DT_BOTTOM|DT_END_ELLIPSIS);
DeleteObject(hRgn1);
DeleteObject(hRgn2);
RestoreDC(pdi->hDC, -1);
return ERROR_USER_ABORT;//I did the drawing
}
}
//I did not do the drawing
//other cases here...............
//for other window messages......
}
return DefWindowProc(hWnd, Message, wParam, lParam);
return SUCCESS;
}
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