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. icon topic. please help

icon topic. please help

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutoriallearning
3 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.
  • V Offline
    V Offline
    Vu Nguyen
    wrote on last edited by
    #1

    Hi all! I use appWizard to make a dialog base program. the default icon for my program will then be the MFC icon. I have a nice (32 X 32) icon file, and want to use it instead. the problem is when I imported this icon into the resource, the size becomes 16 X 16. This make the picture look very ugly. Besides this problem, was another one. What I did to change the icon was I changed the line: //m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); with this line bellow: m_hIcon = AfxGetApp()->LoadIcon(IDI_MY_LOGO); after doing this, my icon was still not visible. I had to delete the MFC icon from the resource to make mine work. Can someone please tell me how to change icon the proper way and how to load 32X32 icons Thank you very much Vu vucsuf

    M 1 Reply Last reply
    0
    • V Vu Nguyen

      Hi all! I use appWizard to make a dialog base program. the default icon for my program will then be the MFC icon. I have a nice (32 X 32) icon file, and want to use it instead. the problem is when I imported this icon into the resource, the size becomes 16 X 16. This make the picture look very ugly. Besides this problem, was another one. What I did to change the icon was I changed the line: //m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); with this line bellow: m_hIcon = AfxGetApp()->LoadIcon(IDI_MY_LOGO); after doing this, my icon was still not visible. I had to delete the MFC icon from the resource to make mine work. Can someone please tell me how to change icon the proper way and how to load 32X32 icons Thank you very much Vu vucsuf

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      I tend to use the resource editor and clear out the contents of the IDR_MAINFRAME image and then paste my icon into IDR_MAINFRAME. Saves a lot of hassle, Michael :-)

      S 1 Reply Last reply
      0
      • M Michael P Butler

        I tend to use the resource editor and clear out the contents of the IDR_MAINFRAME image and then paste my icon into IDR_MAINFRAME. Saves a lot of hassle, Michael :-)

        S Offline
        S Offline
        syedhassan4
        wrote on last edited by
        #3

        Try this Code HICON hIcon; LPCTSTR lpIconName; lpIconName = MAKEINTRESOURCE(IDI_MY_LOGO); hIcon = ::LoadIcon(AfxFindResourceHandle(lpIconName, RT_GROUP_ICON), lpIconName); GetActiveWindow()->SetIcon(hIcon, TRUE); Remember: LoadIcon can only load an icon whose size conforms to the SM_CXICON and SM_CYICON system metric values. Use the LoadImage function to load icons of other sizes. :-O

        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