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. Loading the correct icons

Loading the correct icons

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasesysadminlinuxannouncement
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.
  • R Offline
    R Offline
    Remco Hoogenboezem
    wrote on last edited by
    #1

    Hi, I am trying to make a custom treeview in C++ to display the shell's namespace. It works great for all folders except physical drives and remote or network folders. I can't get the correct icons for these folders. I am using the following code snippet to load the icons for the specified folder: (Only need to obtain the icon index) //Retrieve the icon closed for the folder if(SHGetFileInfo((LPCSTR)lpItemIDList1,0,&fileInfo,sizeof(SHFILEINFO),SHGFI_PIDL|SHGFI_SMALLICON|SHGFI_SYSICONINDEX)==NULL) { lpMalloc->Free(lpItemIDList1); lpEnumIDList->Release(); if(lpSubFolder) { lpSubFolder->Release(); } return FALSE; } lpTreeNode->ImageIndex=fileInfo.iIcon; //Retrieve the icon opened for the folder if(SHGetFileInfo((LPCSTR)lpItemIDList1,0,&fileInfo,sizeof(SHFILEINFO),SHGFI_OPENICON|SHGFI_PIDL|SHGFI_SMALLICON|SHGFI_SYSICONINDEX)==NULL) { lpMalloc->Free(lpItemIDList1); lpEnumIDList->Release(); if(lpSubFolder) { lpSubFolder->Release(); } return FALSE; } lpTreeNode->SelectedIndex=fileInfo.iIcon; The pointer lpItemIDList1 points to a piddle that contains the absolute location of the specified folder. (Relative to the root aka desktop folder) I am only trying to display folders. Thanks :)

    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