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. Question again about changing Icon for the EXE file icon

Question again about changing Icon for the EXE file icon

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiontutorial
10 Posts 4 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.
  • S Offline
    S Offline
    Stan the man
    wrote on last edited by
    #1

    Hi. Thanks for the last responses. After reading further, seticon etc is not whta I wanted to accomplish. I want to change the actual exe icon of the file shown in the directories after I compile. I found out that the FIRST ICON that is listed in the resources VC use this as its icon. My problem is that I can conditional compile and want to be able to change this icon just by setting a define etc. Can anyone suggest how to do this? I do not know how to do this association of this to any lets say ICON after recompilation. I do not want to set it after I start the program. I hope I am clear enough. Thanks for the help. Stan the man

    Steve EcholsS N H 3 Replies Last reply
    0
    • S Stan the man

      Hi. Thanks for the last responses. After reading further, seticon etc is not whta I wanted to accomplish. I want to change the actual exe icon of the file shown in the directories after I compile. I found out that the FIRST ICON that is listed in the resources VC use this as its icon. My problem is that I can conditional compile and want to be able to change this icon just by setting a define etc. Can anyone suggest how to do this? I do not know how to do this association of this to any lets say ICON after recompilation. I do not want to set it after I start the program. I hope I am clear enough. Thanks for the help. Stan the man

      Steve EcholsS Offline
      Steve EcholsS Offline
      Steve Echols
      wrote on last edited by
      #2

      I believe you can use #defines, etc, in your resource files. Just edit your .rc file (might have to do it in an external editor) and do something like: #ifdef MY_CONDITION IDR_MAINFRAME ICON "res\\my_icon_1.ico" #else IDR_MAINFRAME ICON "res\\my_icon_2.ico" #endif That's for an MFC app, but it should be similiar for other types too. Where you define MY_CONDITION is up to you. Could do it in resource.h or in the .rc file itself or include another file.


      - S 50 cups of coffee and you know it's on!

      • S
        50 cups of coffee and you know it's on!
        Code, follow, or get out of the way.
      1 Reply Last reply
      0
      • S Stan the man

        Hi. Thanks for the last responses. After reading further, seticon etc is not whta I wanted to accomplish. I want to change the actual exe icon of the file shown in the directories after I compile. I found out that the FIRST ICON that is listed in the resources VC use this as its icon. My problem is that I can conditional compile and want to be able to change this icon just by setting a define etc. Can anyone suggest how to do this? I do not know how to do this association of this to any lets say ICON after recompilation. I do not want to set it after I start the program. I hope I am clear enough. Thanks for the help. Stan the man

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        Stan the man wrote:

        I found out that the FIRST ICON that is listed in the resources VC use this as its icon. My problem is that I can conditional compile and want to be able to change this icon just by setting a define etc.

        If you are using VC resource editor, then right click on the Icon, select properties and enter the macro name in the condition edit box. So whenever this macro is used then that particular icon will be included else it won't be. From VC Help: Condition Determines the inclusion of the resource. For example, if the condition is _DEBUG, this resource would be included only in debug builds.

        Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

        H 1 Reply Last reply
        0
        • S Stan the man

          Hi. Thanks for the last responses. After reading further, seticon etc is not whta I wanted to accomplish. I want to change the actual exe icon of the file shown in the directories after I compile. I found out that the FIRST ICON that is listed in the resources VC use this as its icon. My problem is that I can conditional compile and want to be able to change this icon just by setting a define etc. Can anyone suggest how to do this? I do not know how to do this association of this to any lets say ICON after recompilation. I do not want to set it after I start the program. I hope I am clear enough. Thanks for the help. Stan the man

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          Did you ask this question,yesterday?

          1 Reply Last reply
          0
          • N Nibu babu thomas

            Stan the man wrote:

            I found out that the FIRST ICON that is listed in the resources VC use this as its icon. My problem is that I can conditional compile and want to be able to change this icon just by setting a define etc.

            If you are using VC resource editor, then right click on the Icon, select properties and enter the macro name in the condition edit box. So whenever this macro is used then that particular icon will be included else it won't be. From VC Help: Condition Determines the inclusion of the resource. For example, if the condition is _DEBUG, this resource would be included only in debug builds.

            Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            Did you get my reply and mail?

            N 1 Reply Last reply
            0
            • H Hamid Taebi

              Did you get my reply and mail?

              N Offline
              N Offline
              Nibu babu thomas
              wrote on last edited by
              #6

              Hamid. wrote:

              Did you get my reply and mail?

              No I didn't receive a mail or reply from you.

              Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

              H 1 Reply Last reply
              0
              • N Nibu babu thomas

                Hamid. wrote:

                Did you get my reply and mail?

                No I didn't receive a mail or reply from you.

                Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                I sent you two mails and also a reply with codeproject([mail]) and it was a question for my why you didnt answer to my mail?(of course Yahoo answered to me mail address not found,did you change your mail?

                N 1 Reply Last reply
                0
                • H Hamid Taebi

                  I sent you two mails and also a reply with codeproject([mail]) and it was a question for my why you didnt answer to my mail?(of course Yahoo answered to me mail address not found,did you change your mail?

                  N Offline
                  N Offline
                  Nibu babu thomas
                  wrote on last edited by
                  #8

                  Hamid. wrote:

                  I sent you two mails

                  I didn't so far get any mails from you :). By the way what was it about?

                  Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

                  H 1 Reply Last reply
                  0
                  • N Nibu babu thomas

                    Hamid. wrote:

                    I sent you two mails

                    I didn't so far get any mails from you :). By the way what was it about?

                    Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #9

                    I have this address of you (NIBUTHOMAS@nestec.net) but it doesnt work. Well it was for new year I think its late for happy new year ;)

                    N 1 Reply Last reply
                    0
                    • H Hamid Taebi

                      I have this address of you (NIBUTHOMAS@nestec.net) but it doesnt work. Well it was for new year I think its late for happy new year ;)

                      N Offline
                      N Offline
                      Nibu babu thomas
                      wrote on last edited by
                      #10

                      Hamid. wrote:

                      I have this address of you (NIBUTHOMAS@nestec.net) but it doesnt work.

                      Sorry that's changed!

                      Hamid. wrote:

                      Well it was for new year I think its late for happy new year

                      Happy new year to you too Hamid. :)

                      Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

                      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