windows 如何更改 C/C++ 中默认的 *.exe 图标?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2325686/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:01:14  来源:igfitidea点击:

How to change the default *.exe icon in C/C++?

c++cwindowsportable-executable

提问by kiddo

I want to change the default .exeicon to some other icon in C/C++. Does anybody know how to do that?

我想将默认.exe图标更改为C/C++ 中的其他图标。有人知道怎么做吗?

采纳答案by Peter Alexander

Already answered.

已经回答了。

Change app icon in Visual Studio 2005?

在 Visual Studio 2005 中更改应用程序图标?

You have to place your .ico file in the resources folder first of course.

当然,您必须首先将 .ico 文件放在资源文件夹中。

回答by Hyman

Use this one: http://www.angusj.com/resourcehacker/

使用这个:http: //www.angusj.com/resourcehacker/

Since you specified that you are using VS2008 I can point you here: How do I set the icon for my application in visual studio 2008?(duplicate question)

由于您指定使用的是 VS2008,我可以在这里指出:如何在 Visual Studio 2008 中为我的应用程序设置图标?(重复问题)

回答by Nick Dandoulakis

On Windows, if the executable contains many icons, the 1st of them will be the default.
If you have icons resource in your programming environment, place the icon you want first in the list.

在 Windows 上,如果可执行文件包含许多图标,则其中的第一个将是默认值。
如果您的编程环境中有图标资源,请将您想要的图标放在列表中的第一个位置。

Edit:since you created an empty project, to add an icon, follow these instructions:

编辑:由于您创建了一个空项目,要添加图标,请按照以下说明操作:

(as I said in my comment, I don't have VS2008, but the steps should be the same)

(正如我在评论中所说,我没有VS2008,但步骤应该是一样的)

Menu: Insert -> Resource -> Import
Select "Icon", press the import button and select your icon file.

菜单:插入 -> 资源 -> 导入
选择“图标”,按导入按钮并选择您的图标文件。

Now, close the icon editor, and save the resource script in the project folder.
Select "Files View" and add the resource script file in the "Resource Files".
That's it.

现在,关闭图标编辑器,并将资源脚本保存在项目文件夹中。
选择“文件视图”,在“资源文件”中添加资源脚本文件。
就是这样。

回答by Anuswadh

if you are using any ide like dev c++, then you can specify the icon you want to appear on your file in project options

如果您使用的是 dev c++ 之类的任何 ide,那么您可以在项目选项中指定要出现在文件上的图标