Setting the compiled program's icon in visual studio
Can visual studio set the .exe's icon? If so, what are the steps I need to go about doing that? Unfortunately I can't seem to find anything on google, I may be searching for the wrong things. I know how to set the form's icon, I'm interested in setting the executable's icon that you see when you double click to open your program.
The icon you see in the explorer is the icon inside the resources with the lowest ID. Just add the icon into your resource section.
If there are other icons with lower IDs you may have to manually edit resource.h to switch values around.
If there are other icons with lower IDs you may have to manually edit resource.h to switch values around.
What language are you using and what version of Visual Studio? The method for, say VB6, is completely different to the method of doing it in VC++ 2005 Express (which isn't helped by the fact that VC++ Express doesn't have a resource editor).
Let me also say that simply having a .ico file loaded into my project under the resources section is not doing anything. That and this is a console project with SDL and OpenGL, not a windows project.
That works for me.
I created a console project, i chose project->add resource, chose icon and painted some lines in the icon field. Then press Ctrl-S and compile. Voila, the exe has got the icon.
Check if you really have a .rc-file added to your project, it happens that the resource is not added.
I created a console project, i chose project->add resource, chose icon and painted some lines in the icon field. Then press Ctrl-S and compile. Voila, the exe has got the icon.
Check if you really have a .rc-file added to your project, it happens that the resource is not added.
Quote:Original post by Endurion
That works for me.
I created a console project, i chose project->add resource, chose icon and painted some lines in the icon field. Then press Ctrl-S and compile. Voila, the exe has got the icon.
Check if you really have a .rc-file added to your project, it happens that the resource is not added.
This works for me as well. You could also try adding both a 16x16 icon and a 32x32 icon, since one is use for viewing in explorer and another is used for the taskbar (I think).
Good Luck
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement