Question again about changing Icon for the EXE file icon
-
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
-
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
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!
-
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
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
-
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
Did you ask this question,yesterday?
-
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
Did you get my reply and mail?
-
Did you get my reply and mail?
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
-
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
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?
-
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?
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
-
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
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 ;)
-
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 ;)
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