CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Jan 2003
    Posts
    375

    Unhappy Set the icon of the .exe file

    I have a MFC dialog project, I move all the icons including the IDR_MAINFRAME icon into a resource-only DLL, so there is no icon embedded in the executable file. In the dialog initialization, the dialog loads the icons using LoadIcon(hResdll, MAKEINTRESOURCE(IDI_MYICON))). The icons shows correctly on the dialog.

    But in the Windows Explorer, the icon of the .exe file is not the icon of IDR_MAINFRAME, I check the resource file in the resource-only dll project, the ID number of the IDR_MAINFRAME is the lowest one of all icon ID numbers. I also try
    Code:
    SetClassLongPtr(m_hWnd, GCLP_HICON, (LONG)LoadIcon(hResdll, MAKEINTRESOURCE(IDR_MAINFRAME)));
    But it doesn't work. The IDR_MAINFRAME icon doesn't show in the Explorer window, the system provides a default icon for the .exe file.

    Thanks for any help!
    Last edited by forester; October 9th, 2013 at 07:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured