codeblocks 编译出来的exe 和 DLL 没有图标和版本附加信息。
那么需要使用。
做个 test.rc 文件,内容为
-
#include <windows.h>
-
#include <commctrl.h>
-
#include <richedit.h>
-
-
MAINICON ICON "E:\\128.ico"
-
//
-
// Version Information resources
-
//
-
LANGUAGE 4, SUBLANG_SYS_DEFAULT
-
1 VERSIONINFO
-
FILEVERSION 1,2,0,0
-
PRODUCTVERSION 1,2,0,0
-
FILEOS VOS_UNKNOWN
-
FILETYPE VFT_DLL
-
FILESUBTYPE VFT2_UNKNOWN
-
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE | VS_FF_PATCHED | VS_FF_PRIVATEBUILD | VS_FF_INFOINFERRED | VS_FF_SPECIALBUILD
-
FILEFLAGS 0
-
{
-
BLOCK "StringFileInfo"
-
{
-
BLOCK "080403A8"
-
{
-
VALUE "Comments", ""
-
VALUE "CompanyName", "Iceland"
-
VALUE "FileDescription", "Knight_DLLx64"
-
VALUE "FileVersion", "1.2.0.0"
-
VALUE "InternalName", "Knight"
-
VALUE "LegalCopyright", "ND CopyRight"
-
VALUE "LegalTrademarks", ""
-
VALUE "OriginalFilename", ""
-
VALUE "PrivateBuild", ""
-
VALUE "ProductName", "DLLx64_Knight"
-
VALUE "ProductVersion", "VER1.2"
-
VALUE "SpecialBuild", ""
-
}
-
}
-
BLOCK "VarFileInfo"
-
{
-
VALUE "Translation", 0x0804, 0x03A8
-
}
-
}
把RC文件放入工程中,编译后 exe 就用了图标。
如果用版本信息,可以使用 ResEdit 工具。
1. 把 DLL 或者 exe 拖进 ResEdit.exe
2. 添加资源信息。如图步骤




好用,真好用
阅读(1676) | 评论(0) | 转发(0) |