方法只要幾個步驟就行了,以下:windows
1.準備好一個ico格式的圖標文件,例如demo.icospa
2.建立一個rc文件, 例如demo.rc. 並copy下面代碼:.net
// 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:其實只要前面兩行就行了,下邊是弄版本信息的code
3.在工程文件.pro中鍵入下面代碼:orm
RC_FILE = demo.rc
4.編譯一下就行了blog