How to change an embedded icon of a .exe file?

Posted on 2003-12-10
Last Modified: 2012-05-04
Hi, dudes, i've got a exe file in windows, but now i want to change the embedded icon of it. is there anyone know how to achieve it? is that possible to do it using MS VisualC++? or other utilities......

Thanks in advance!

Question by:boyeric

Expert Comment

ID: 9913409
i've tried to write this once before and although every function was returning a success indication it didn't actually work. i haven't been able to look at it since but you are supposed to be able to do this using. UpdateResource, you first have to find the icon which should be of type RT_ICON, and the resource id should be 1
i'm not 100% if you also need to change an RT_GROUP_ICON along with it, i read somewhere that you did. you use FindResource to find the icon in the exe , which shouldn't be running, then use BeginUpdateResource, UpdateResource, and EndUpdateResource.
for some reason when i did this a tmp file was created in the directory of the exe and the icon didn't change. like i said everything returned succesfully and ive used these functions before. i've written and updated exe's that contained other exes (raw binary resources) sort of like exe binding. if anyone knows more please post.
also, you can use an HICON it has to be the type of raw ico data that would be in the exe

Expert Comment

ID: 9914681
If you are using VC++/VS just go to file|open (select the all files mask) locate your exe and open it. VS should no what to do with it. All the resources in that app will be displayed according to their type in a tree view. Next find your icon edit it in VS or copy it to the clipboard and paste it back in (make sure you keep/select the transparent color) then save it out file|save. The exe should be saved with the new icon.

Expert Comment

ID: 9917586
maybe i read the question wrong, do you want to just change the exe once on your computer for your use or do you want to know how to programatically do it through c++ code to any other exe file???
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center


Accepted Solution

chsoh earned 128 total points
ID: 9917815
You may consider this product.

Expert Comment

ID: 9917842
If I understand correctly you want to basically set an icon (eg. your own 32x32 bitmap) for your program? In VC++ in the Winmain function when you declare your WNDCLASS values you should change this value:

wndclass.hIcon         = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_MYICON));

Where IDI_MYICON is your included resource 32x32 ico file.

Author Comment

ID: 10038969
Hi, chsoh, although you've given the laziest answer, anyway i have to admit that's the most practical of all. Thanks much!

Expert Comment

ID: 10246514
If i need to  change program icon.  I would use microangelo from  and just use librarian part and go change icon :)


use reshack from to change icon  :)    

few ways to do the icon changing.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Currency Conversion? 1 99
Recommendation vb6 to or others 14 178
Restore Windows 7 Snipping Tool function to Windows 10 10 76
ejb message driven bean mdb creation steps 2 24
This article will show, step by step, how to integrate R code into a R Sweave document
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question