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. How to get the file icon and insert to listctrl?

How to get the file icon and insert to listctrl?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
9 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.
  • Y Offline
    Y Offline
    york528
    wrote on last edited by
    #1

    As the subject says,how to get it? Thank you!~~ ;P

    J H 3 Replies Last reply
    0
    • Y york528

      As the subject says,how to get it? Thank you!~~ ;P

      J Offline
      J Offline
      Jijo Raj
      wrote on last edited by
      #2

      Get the file icon by calling SHGetFileInfo() with uFlags as SHGFI_ICON and you'll get the HICON handle. Get the ImageList of your list ctrl and add the file icon to it by calling CImageList::Add(), so that you can add that icon to your list ctrl. For adding new item to list ctrl, refer http://www.functionx.com/visualc/controls/listcontrol.htm[^] Regards, Jijo.

      _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

      Y 1 Reply Last reply
      0
      • J Jijo Raj

        Get the file icon by calling SHGetFileInfo() with uFlags as SHGFI_ICON and you'll get the HICON handle. Get the ImageList of your list ctrl and add the file icon to it by calling CImageList::Add(), so that you can add that icon to your list ctrl. For adding new item to list ctrl, refer http://www.functionx.com/visualc/controls/listcontrol.htm[^] Regards, Jijo.

        _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

        Y Offline
        Y Offline
        york528
        wrote on last edited by
        #3

        Thank you so much ,Jijo

        1 Reply Last reply
        0
        • Y york528

          As the subject says,how to get it? Thank you!~~ ;P

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          See here[^] and here[^].

          1 Reply Last reply
          0
          • Y york528

            As the subject says,how to get it? Thank you!~~ ;P

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            See here[^] and here[^].

            Y 1 Reply Last reply
            0
            • H Hamid Taebi

              See here[^] and here[^].

              Y Offline
              Y Offline
              york528
              wrote on last edited by
              #6

              The Demo is very good I know how to set the icon now Thanks a lot!~~~ :-D :-D :-D

              H 1 Reply Last reply
              0
              • Y york528

                The Demo is very good I know how to set the icon now Thanks a lot!~~~ :-D :-D :-D

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                Oh thanks for your votes. :-D

                Y 1 Reply Last reply
                0
                • H Hamid Taebi

                  Oh thanks for your votes. :-D

                  Y Offline
                  Y Offline
                  york528
                  wrote on last edited by
                  #8

                  I voted twice ;P ;P ;P ;P

                  H 1 Reply Last reply
                  0
                  • Y york528

                    I voted twice ;P ;P ;P ;P

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #9

                    And Im thankful twice. :-D

                    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