Overlay icon in CListView
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I have MFC SDI project and CListView inside. I would like to have overlay images in my list control. In image list I have some images set with SetOverlayImage, and I use CListCtrl::SetItemState with LVIS_OVERLAYMASK and INDEXTOOVERLAYMASK. Overlay images are still not shown, just the main image. This is cleansed code:
extern CListView\* pLV; CListCtrl\* pLC = pLV->GetListCtrl(); imageList.Add((HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI\_MAIN\_IMAGE), IMAGE\_ICON, 32, 32, 0)); imageList.Add((HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI\_OVERLAY\_IMAGE), IMAGE\_ICON, 32, 32, 0)); imageList.SetOverlayImage(1, 1); pLC->SetImageList(&imageList, LVSIL\_NORMAL); pLC->InsertItem(0, \_T("Testing"), 0); pLC->SetItemState(0, INDEXTOOVERLAYMASK(1), LVIS\_OVERLAYMASK);
What am I doing wrong?