Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Overlay icon in CListView

Overlay icon in CListView

Scheduled Pinned Locked Moved C / C++ / MFC
c++testingbeta-testingquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dialecticus
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups