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. Large Icon display in Explorer view

Large Icon display in Explorer view

Scheduled Pinned Locked Moved C / C++ / MFC
announcement
4 Posts 3 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.
  • B Offline
    B Offline
    BicycleTheif
    wrote on last edited by
    #1

    I have created a Explorer type application in which i have problems in viewing the large icons.When i update the List view to display the files and folders in a particular path i am getting only the text display not the image. Any suggestion or article of this kind will be helpful Thanks

    H N 2 Replies Last reply
    0
    • B BicycleTheif

      I have created a Explorer type application in which i have problems in viewing the large icons.When i update the List view to display the files and folders in a particular path i am getting only the text display not the image. Any suggestion or article of this kind will be helpful Thanks

      H Offline
      H Offline
      Halawlaws
      wrote on last edited by
      #2

      If i understand u correctly u want to add an icon for ur tree component. U can choose between the two function i worked on before. the first function is for getting the icon from ur computer(The one specified in the folder option FileTypes Tab) HICON CMyTreeCtrl::GetIcon(CString pathFileName) { // Call SHGetFileInfo to get the icon. Call with dummy filename and // SHGFI_USEFILEATTRIBUTES flag, so file doesn't actually have to // exist. SHFILEINFO shfi; memset(&shfi,0,sizeof(shfi)); SHGetFileInfo(pathFileName, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_ICON| SHGFI_USEFILEATTRIBUTES| SHGFI_SHELLICONSIZE | SHGFI_SMALLICON); return shfi.hIcon; } And the second one if u want to customizeur own images: First create the icons then Create an imagelist and do the following m_imageList.Create(16,16,0,3,2); m_imageList.SetBkColor(RGB(255,255,255)); HICON hIcon; hIcon = AfxGetApp()->LoadIcon(IDI_ICON2); //Folder eg m_imageList.Add(hIcon); hIcon = AfxGetApp()->LoadIcon(IDI_ICON3); //File eg m_imageList.Add(hIcon); m_T.SetImageList(&m_imageList,TVSIL_NORMAL); I hope this helps /\|-||\/|/\|)

      B 1 Reply Last reply
      0
      • H Halawlaws

        If i understand u correctly u want to add an icon for ur tree component. U can choose between the two function i worked on before. the first function is for getting the icon from ur computer(The one specified in the folder option FileTypes Tab) HICON CMyTreeCtrl::GetIcon(CString pathFileName) { // Call SHGetFileInfo to get the icon. Call with dummy filename and // SHGFI_USEFILEATTRIBUTES flag, so file doesn't actually have to // exist. SHFILEINFO shfi; memset(&shfi,0,sizeof(shfi)); SHGetFileInfo(pathFileName, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_ICON| SHGFI_USEFILEATTRIBUTES| SHGFI_SHELLICONSIZE | SHGFI_SMALLICON); return shfi.hIcon; } And the second one if u want to customizeur own images: First create the icons then Create an imagelist and do the following m_imageList.Create(16,16,0,3,2); m_imageList.SetBkColor(RGB(255,255,255)); HICON hIcon; hIcon = AfxGetApp()->LoadIcon(IDI_ICON2); //Folder eg m_imageList.Add(hIcon); hIcon = AfxGetApp()->LoadIcon(IDI_ICON3); //File eg m_imageList.Add(hIcon); m_T.SetImageList(&m_imageList,TVSIL_NORMAL); I hope this helps /\|-||\/|/\|)

        B Offline
        B Offline
        BicycleTheif
        wrote on last edited by
        #3

        Thanks for your reply. What exactly my problem is when i clicked the LARGE ICON Button on the applications tool bar or select it from the View menu the Icons are not getting displayed in the List view. I am able to see the icons in other views namely Details,Small Icons ,Lists. There's absolutely no problem with the tree view.

        1 Reply Last reply
        0
        • B BicycleTheif

          I have created a Explorer type application in which i have problems in viewing the large icons.When i update the List view to display the files and folders in a particular path i am getting only the text display not the image. Any suggestion or article of this kind will be helpful Thanks

          N Offline
          N Offline
          Nishad S
          wrote on last edited by
          #4

          I think you probably didn't load/set icons for large view, did you? - NS -

          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