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. List view doesn't want to make friends with image list

List view doesn't want to make friends with image list

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 2 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.
  • A Offline
    A Offline
    Alex Orovetskiy
    wrote on last edited by
    #1

    At least in my case. What I am trying to do is to obtain an icon from an executable and to add it among with exe name to the report-styled list control. if(ExtractIconEx(str,0,NULL,NULL,0) > 0) { ExtractIconEx(str,0,NULL,&hIcon,1); m_plistIcons->Add(hIcon); } else m_plistIcons->Add(m_hIcon); What I get is while every run the handle is different and after the loop ends image list contains 37 entries the only icon which is applied to absolutly all list items is the first added to the image list. Image list is being attached to list control using this line: m_ProcList.SetImageList(m_plistIcons,LVSIL_SMALL); I am quite sure I'm doing something wrong. I just dunno what. -- modified at 4:49 Saturday 10th December, 2005

    A 1 Reply Last reply
    0
    • A Alex Orovetskiy

      At least in my case. What I am trying to do is to obtain an icon from an executable and to add it among with exe name to the report-styled list control. if(ExtractIconEx(str,0,NULL,NULL,0) > 0) { ExtractIconEx(str,0,NULL,&hIcon,1); m_plistIcons->Add(hIcon); } else m_plistIcons->Add(m_hIcon); What I get is while every run the handle is different and after the loop ends image list contains 37 entries the only icon which is applied to absolutly all list items is the first added to the image list. Image list is being attached to list control using this line: m_ProcList.SetImageList(m_plistIcons,LVSIL_SMALL); I am quite sure I'm doing something wrong. I just dunno what. -- modified at 4:49 Saturday 10th December, 2005

      A Offline
      A Offline
      Alex Orovetskiy
      wrote on last edited by
      #2

      Nobody knows ? Not a single human being ? I take help from aliens as well...as long as you speak the language I speak :)

      O 1 Reply Last reply
      0
      • A Alex Orovetskiy

        Nobody knows ? Not a single human being ? I take help from aliens as well...as long as you speak the language I speak :)

        O Offline
        O Offline
        Optimus Chaos
        wrote on last edited by
        #3

        Maybe it depends on how you add the items to your list control. By default the CListCtrl assumes to use image 0 for all items. You have to specify for every item which image it should use.

        A 1 Reply Last reply
        0
        • O Optimus Chaos

          Maybe it depends on how you add the items to your list control. By default the CListCtrl assumes to use image 0 for all items. You have to specify for every item which image it should use.

          A Offline
          A Offline
          Alex Orovetskiy
          wrote on last edited by
          #4

          Wow. Some people wonder outside of page 1 :) Anyway I've figured it out on my own but thanks anyway. -------------------------------- Human stupidity is infinite.

          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