方法只要几个步骤就好了,如下:
1.准备好一个ico格式的图标文件,例如demo.ico
2.创建一个rc文件, 例如demo.rc. 并copy下面代码:
// Generated by ResEdit 1.4.13 // Copyright (C) 2006-2010 // http://www.resedit.net #include <windows.h> IDI_ICON1 ICON DISCARDABLE "images\demo.ico" // // Version Information resources // LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 1 VERSIONINFO FILEVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1 FILEOS VOS_UNKNOWN FILETYPE VFT_UNKNOWN FILESUBTYPE VFT2_UNKNOWN FILEFLAGSMASK 0x00000000 FILEFLAGS 0x00000000 { BLOCK "StringFileInfo" { BLOCK "04000025" { VALUE "CompanyName", "xjc" VALUE "FileVersion", "1,0,0,1" } } BLOCK "VarFileInfo" { VALUE "Translation", 0x0400, 0x0025 } }
ps:其实只要前面两行就好了,下边是弄版本信息的
3.在工程文件.pro中键入下面代码:
RC_FILE = demo.rc
4.编译一下就好了