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