VC++中exe的图标(转自MSDN论坛)

The way Windows chooses the icon of the

main executable file is that it looks for the first icon in the

resource section of the executable, or something along these lines.

First of all, you need to add a resource script, .rc file. This is done

through Project->Add New Item or right click on solution explorer

and go to Add->New Item. Chose Resource->Resrouce File(.rc) name

it then add it.

Now you have the resource file then you add the icon to it. Go to

resource view and right click on the name of your resource file. Right

at the bottom you will find Add Resource, select that then a new window

will pop up.

If you already have your icon saved seperatly then you should choose

Import and then import the icon. Otherwise select Icon and then

press New. The icon will be created and/or added to the resource script

and you will find that when you build your project it will be the icon

for the executable file.

If you want more than one icon in a project, make sure to add the

one you want as the executable icon first, otherwise you will have to

change the resource identifiers and put that icon as the lowest id.

By Lu Jun

80后男,就职于软件行业。习于F*** GFW。人生48%时间陪同电子设备和互联网,美剧迷,高清视频狂热者,游戏菜鸟,长期谷粉,临时果粉,略知摄影。

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.