Solved

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

Posted on 2003-12-10
7
2,309 Views
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!

Eric
0
Comment
Question by:boyeric
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 6

Expert Comment

by:PlanetCpp
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
0
 

Expert Comment

by:stzizza
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.
0
 
LVL 6

Expert Comment

by:PlanetCpp
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???
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Accepted Solution

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

http://www.qwerks.com/product.asp?ProductID=5013
0
 
LVL 1

Expert Comment

by:georgiek50
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.
0
 

Author Comment

by:boyeric
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!
0
 
LVL 1

Expert Comment

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

OR

use reshack from http://anton.concord.ru/ftp/reshack/ to change icon  :)    


few ways to do the icon changing.

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Introduction to Processes

615 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