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. Changing Icon displayed by Windows Explorer for MFC program

Changing Icon displayed by Windows Explorer for MFC program

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 Posts 3 Posters 1 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.
  • H Offline
    H Offline
    Harold Bamford
    wrote on last edited by
    #1

    Greetings, I have modified the icon file for my program (res\myprog.ico) but I am still getting that old MFC "3 cubes" icon displayed in the title bar and as the icon for the executable file in Explorer. Is there some secret trick to getting that new icon used? Oddly, if I right-click on the executable's icon in Windows Explorer and bring up the properties dialog, the new icon is displayed, so I obviously did something right. Just not enough. Can some kind soul please point out the steps to fix this? Thanks!

    R G 2 Replies Last reply
    0
    • H Harold Bamford

      Greetings, I have modified the icon file for my program (res\myprog.ico) but I am still getting that old MFC "3 cubes" icon displayed in the title bar and as the icon for the executable file in Explorer. Is there some secret trick to getting that new icon used? Oddly, if I right-click on the executable's icon in Windows Explorer and bring up the properties dialog, the new icon is displayed, so I obviously did something right. Just not enough. Can some kind soul please point out the steps to fix this? Thanks!

      R Offline
      R Offline
      Rohit Sinha
      wrote on last edited by
      #2

      Heh, I remember this happened to me when I wrote my first MFC program. Ah, the old days... :) Anyway, there are two common sizes of icons displayed. 16x16 pixels and 32x32 pixels. You have apparently changed only one of them, which is the reason why you see the updated one in the properties dialog box and the old on in the explorer view. There is a small drop down right above the space where you edit your icon when you have it open, labelled "Device". Select the size you want from there and edit it. You can even insert icons of new sizes by clicking on the small "New Device Image" icon next to the drop down. Save and build, and lo and behold, your new icon shows up now.
        Regards,

      Rohit Sinha

      H 1 Reply Last reply
      0
      • R Rohit Sinha

        Heh, I remember this happened to me when I wrote my first MFC program. Ah, the old days... :) Anyway, there are two common sizes of icons displayed. 16x16 pixels and 32x32 pixels. You have apparently changed only one of them, which is the reason why you see the updated one in the properties dialog box and the old on in the explorer view. There is a small drop down right above the space where you edit your icon when you have it open, labelled "Device". Select the size you want from there and edit it. You can even insert icons of new sizes by clicking on the small "New Device Image" icon next to the drop down. Save and build, and lo and behold, your new icon shows up now.
          Regards,

        Rohit Sinha

        H Offline
        H Offline
        Harold Bamford
        wrote on last edited by
        #3

        Bless you! That did it! Jeez! Once you told me the secret, it took me all of 60 seconds to fix it. Thank you very much!

        1 Reply Last reply
        0
        • H Harold Bamford

          Greetings, I have modified the icon file for my program (res\myprog.ico) but I am still getting that old MFC "3 cubes" icon displayed in the title bar and as the icon for the executable file in Explorer. Is there some secret trick to getting that new icon used? Oddly, if I right-click on the executable's icon in Windows Explorer and bring up the properties dialog, the new icon is displayed, so I obviously did something right. Just not enough. Can some kind soul please point out the steps to fix this? Thanks!

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #4

          Icons come in different sizes (32x32, 16x16, etc.) and color depths (16 colors, 256, ...). Windows picks which one to display based upon what's needed. You need to make sure you change all of the versions in your resource.


          Software Zen: delete this;

          H 1 Reply Last reply
          0
          • G Gary R Wheeler

            Icons come in different sizes (32x32, 16x16, etc.) and color depths (16 colors, 256, ...). Windows picks which one to display based upon what's needed. You need to make sure you change all of the versions in your resource.


            Software Zen: delete this;

            H Offline
            H Offline
            Harold Bamford
            wrote on last edited by
            #5

            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