Online look for a bit, probably can summarize has
Method One:
To change the icon, you can see the ID value of each resource after opening in Resource.h, general MFC Auto-generated IDR_MAINFRAME is 128, it will add more than 128, the sequential delay, compile by default will be the smallest ID as exe icon, So as long as we can change it, or the above dialog box, change Idi_icon1 to 128, change the idr_mainframe to another larger number can not be too large, because there may be other uses, and then re-rebuild, At this point, you can see the EXE icon has become its own idi_icon1 icon.
Method Two:
1, in the Program Res folder, delete the MFC icon file, add their own icon file;
2. In the Properties dialog box of the icon idr_mainframe, modify the file name path to your own icon files.
Self According to two methods are changed, but debug and realease compile generated program icons have not changed, did not have the result of the afternoon;
But when I saw this blog post 50644792, clairvoyant
In fact, the icon has been changed, but due to system problems, the cache is not refreshed, so the change of the icon is not shown, just to rebuild the cache can be.
Build a TXT file under the project to add:
REM Shut down Windows Explorer
taskkill/f/im Explorer.exe
REM Cleanup System icon Cache database
Attrib-h-s-r "%userprofile%\appdata\local\iconcache.db"
del/f "%userprofile%\appdata\local\iconcache.db"
attrib/s/d-h-s-r "%userprofile%\appdata\local\microsoft\windows\explorer\*"
del/f "%userprofile%\appdata\local\microsoft\windows\explorer\thumbcache_32.db"
del/f "%userprofile%\appdata\local\microsoft\windows\explorer\thumbcache_96.db"
del/f "%userprofile%\appdata\local\microsoft\windows\explorer\thumbcache_102.db"
del/f "%userprofile%\appdata\local\microsoft\windows\explorer\thumbcache_256.db"
del/f "%userprofile%\appdata\local\microsoft\windows\explorer\thumbcache_1024.db"
del/f "%userprofile%\appdata\local\microsoft\windows\explorer\thumbcache_idx.db"
del/f "%userprofile%\appdata\local\microsoft\windows\explorer\thumbcache_sr.db"
REM Cleaning system Tray memory icon
echo y|reg Delete "hkey_classes_root\local settings\software\microsoft\windows\currentversion\traynotify"/ V IconStreams
echo y|reg Delete "hkey_classes_root\local settings\software\microsoft\windows\currentversion\traynotify"/ V PastIconsStream
rem Restart Windows Shell Explorer
Start explorer
Named Xxx.bat, Notepad, select Save As, all files
MFC: Modify build EXE file icon