Skip to main content
GameDev.net gamedev.net
🔒 Locked

Setting the compiled program's icon in visual studio

Started by M2tM Mar 8, 2006 at 1:32 AM 6 replies 24.8k views
Original Post
M2tM
M2tM
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.
_____"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk
Endurion
Endurion
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.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
trevaaar
trevaaar
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).
M2tM
M2tM
I'm using C++ in Visual Studio 2003
_____"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk
M2tM
M2tM
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.
_____"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk
Endurion
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.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
Simian Man
Simian Man
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
M2tM
M2tM
Got it working. I was doing something silly: just dragging the .ico into the resources and hoping it would work (instead of clicking add->resource). ^^ Thanks guys.
_____"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.