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. Get system image list not working in some cases

Get system image list not working in some cases

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
3 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.
  • _ Offline
    _ Offline
    _Flaviu
    wrote on last edited by
    #1

    I am trying to get an image list handle from system icons, like that:

    return (HIMAGELIST)SHGetFileInfo(_T("c:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON);

    and is working good, except on some PCs, where there is some icons without any icon. I am using this handle to a CListCtrl: Where icon has found: Capture — Postimage.org[^] Where icon hasn't: Capture2 — Postimage.org[^] Of course that OS has the icon and program for every type of files, including case where my code dont't work ... Last edit: Here is what is looking the list control with this state of icons: Capture — Postimage.org[^] So one of files has icons, one hasn't ... and I am not figure out why ...

    L 1 Reply Last reply
    0
    • _ _Flaviu

      I am trying to get an image list handle from system icons, like that:

      return (HIMAGELIST)SHGetFileInfo(_T("c:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON);

      and is working good, except on some PCs, where there is some icons without any icon. I am using this handle to a CListCtrl: Where icon has found: Capture — Postimage.org[^] Where icon hasn't: Capture2 — Postimage.org[^] Of course that OS has the icon and program for every type of files, including case where my code dont't work ... Last edit: Here is what is looking the list control with this state of icons: Capture — Postimage.org[^] So one of files has icons, one hasn't ... and I am not figure out why ...

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Try adding some debug code to see exactly what is being returned on your call to SHGetFileInfo.

      _ 1 Reply Last reply
      0
      • L Lost User

        Try adding some debug code to see exactly what is being returned on your call to SHGetFileInfo.

        _ Offline
        _ Offline
        _Flaviu
        wrote on last edited by
        #3

        I have solved, I have used the same image list handle for two controls, CTreeCtrl and CListCtrl ... and I haven't share this image list correctly ... now everything is alright.

        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