Archived

This topic is now archived and is closed to further replies.

MuruGuru

Setting an icon for my .exe file in vc++

Recommended Posts

NewbieGamer    122
I suppose you are using VC IDE [Studio]. Goto your workspace and see if you have a folder called resource files. There double click on the RC file.
Then right click and select "Add resource"
Here you select from several resource types. [Choose icon].
Draw some icon image...... or if you have an image already... select import.

HTH,

Cheers!!!
V!

Share this post


Link to post
Share on other sites
NewbieGamer    122
One crude [a.k.a hackish] way of doing this is to promote the "filename.ico" that you want to be set as the app''s icon to the IDI_ICON1 value in your RC file. [Open the .RC in a text editor].

If your .RC file looks like
IDI_ICON1 ICON "icon1.ico"
IDI_ICON2 ICON "icon2.ico"
IDI_ICON3 ICON "icon3.ico"
IDI_ICON4 ICON "icon4.ico"

and if "icon4.ico" is what you want to be set at your app icon, switch the order so that you get the following.
IDI_ICON1 ICON "icon4.ico"
IDI_ICON2 ICON "icon2.ico"
IDI_ICON3 ICON "icon3.ico"
IDI_ICON4 ICON "icon1.ico"

WARNING:
The only caveat is if you have too many icons that have been created already and are used for other purposes, you have to change their IDs appropriately.....



Cheers!!!
V!

Share this post


Link to post
Share on other sites
NewbieGamer    122
Oooppsss!!!!
Agree with Kihaji....
I should have read your question a little more carefully. Sorry about that.

LoadIcon() should settle the case. If you are in a dialog based application you should have a way to do it in your OnInitDialog().
Set the m_hIcon to AfxGetApp()->LoadIcon(IDI_ICON_ID);

HTH,


Cheers!!!
V!

Share this post


Link to post
Share on other sites