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

Thread: Icons

  1. #1
    Xeon's Avatar
    Xeon is offline Want me to ban you?! Power Poster
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    4,195

    Icons

    Hi there! Whenever I create an MFC application(dialog based), AppWizard will auto-generate a 3D MFC icon, right? The name of the 3D MFC icon is IDR_MAINFRAME by default, right?
    How do I do it in such a way that I can replace the default MFC icon with a icon of my own in the program's title bar? Thanks!

    "Hell is calling for you!" - Rufus, from Valkyrie Profile 2 : Silmeria

    "I'm getting tired of you devils.....finishing strike......Final Blast!" - Arngrim, from Valkyrie Profile 2 : Silmeria

  2. #2
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658

    Re: Icons

    Use resource editor. In the properties of the IDR_MAINFRAME change the file name to your

    Rating isn't important...But gurus respect it and keep high

  3. #3
    Join Date
    Sep 2003
    Location
    M...N
    Posts
    220

    Re: Icons

    Strange, I tried it on several testing project, and all worked fine.

    But after I tried it on my main project, which has RC seperated on different dll, it just doens't have the right-look on the windows explorer.
    Attached Images Attached Images  

  4. #4
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Icons

    Quote Originally Posted by myron
    Strange, I tried it on several testing project, and all worked fine.

    But after I tried it on my main project, which has RC seperated on different dll, it just doens't have the right-look on the windows explorer.
    You are aware that you are answering a four-years old question?

  5. #5
    Join Date
    Sep 2003
    Location
    M...N
    Posts
    220

    Re: Icons

    Quote Originally Posted by Andreas Masur
    You are aware that you are answering a four-years old question?

    yes, and 4 years pass, the question still exists. However, some rookies should have become gurus, and hope someone could answer this problem.

  6. #6
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Icons

    Quote Originally Posted by Andreas Masur
    You are aware that you are answering a four-years old question?
    Oh, so that's why Xeon was asking this kind of question.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  7. #7
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Icons

    Quote Originally Posted by myron
    yes, and 4 years pass, the question still exists. However, some rookies should have become gurus, and hope someone could answer this problem.
    Well....the original question was indeed already answered. And if yours is a new question...it should have gone in its own thread...nevertheless, I am not sure what your problem is, however, the explorer for example does not change the icons immediately if they get changed....either through code or file extension assignment...

  8. #8
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658

    Re: Icons

    Having RC in different DLLs you should use AfxGet/SetResourceHandle or
    AFX_MANAGE_STATE ( AfxGetStaticModuleState() ); depending from type of DLL

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