Regenerate your makefile and your application. The .exe file will now be represented with your icon in Explorer.
If you do not use qmake, the necessary steps are: first, run the rc program on the .rc file, then link your application with the resulting .res file.
其实就是把你的图标转成 .ico 的文件,比如名为:myappico.ico。然后加个到 .rc文件中。
.rc文件使用记事本建立就行,其中添加一行
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
保存
如果你使用 qmake 来生成你的makefile的话。就在.pro 文件中加入如下一行:
RC_FILE = myapp.rc
这样再qmake 生成的程序就有图标了