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

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!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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.
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???
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

You may consider this product.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
boyericAuthor Commented:
Hi, chsoh, although you've given the laziest answer, anyway i have to admit that's the most practical of all. Thanks much!
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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.