Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/articles/mfc-tutorials/)
-   -   Change Icon of EXE file through code extracting it from other EXE file (http://www.go4expert.com/articles/change-icon-exe-file-code-extracting-t643/)

shabbir 23Aug2007 17:57

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Quote:

Originally Posted by ibraheempindi
i have both of them, one contained the project source while other contains the binary, but there is no sample exe's to use as source and dest on which it will work...... :rolleyes:

You can keep the exe and its copy and then run the application with the source file as some notepad and the destination one as the copy exe and then it will update the copy exe correctly. It will work on exe which has only one Icon embedded.

ibraheempindi 24Aug2007 13:01

Re: Change Icon of EXE file through code extracting it from other EXE file
 
yeah...that's why may be its not working with mine ones...but in prof products its rare to hve one icon, and each icon have several images, i'm trying to update one, and playing around with it, but it merges some images of an ico file from destination and some from source in the same ico file.....is it posb to make it work for multiple icon embeded application and to update an ico resource with multiple images in it....thanks for your time

shabbir 24Aug2007 17:24

Re: Change Icon of EXE file through code extracting it from other EXE file
 
The code can always be updated to change all the icons. I have given here how to do it (a prototype) and it can always be extended. Isn't it?

ibraheempindi 24Aug2007 19:56

Re: Change Icon of EXE file through code extracting it from other EXE file
 
hmmm..i think soo....by changing these two params,
one is the 3rd param of updateresource and other is FindResource 2nd param in source exe, you can browse arount the images placed in that ico file, and replace as you wish them to be, so its working now, but could you give me some hints that instead of source exe, if i have to load an *.ico image file and then replace the resource in the desitnation exe...how it would be...thanks and have a nice day :)

shabbir 24Aug2007 22:11

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Read through the comments and you will find that as well.

mudasir 31Oct2007 11:10

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Dear Shabir
i have run ur code to change the icon of an exe file .But i change the icon of an exe file only once.next time u run this code nothing happens(until i restart my computer).in fact in output window a message is displayed which is

The therad 'win32 Thread' has exited with code 0 (0*0)
The program '[3628]' Exeupdate.exe Native ' has exited with code 0 (0*0)

will u plz guide me about this problem.

shabbir 31Oct2007 11:30

Re: Change Icon of EXE file through code extracting it from other EXE file
 
I am unable to re-create your problem but it looks like the exe file you are trying to change is locked by some process and it may be the ExeUpdater which is used for first time. Check if that is the case.

mudasir 1Nov2007 12:02

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Let me explain
when i run this code then the icon of my exe file flushes once to new ion then again becoms the original icon.(e.g i want to change of msn.exe Icon with yahoo.exe Icon but msn icon again changes to msn Icon).

shabbir 1Nov2007 17:14

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Quote:

Originally Posted by mudasir
Let me explain
when i run this code then the icon of my exe file flushes once to new ion then again becoms the original icon.(e.g i want to change of msn.exe Icon with yahoo.exe Icon but msn icon again changes to msn Icon).

Try seeing in resource hacker and see if it gets replaced by some icon / icon group and then MSN flushes and shows some other icon group in explorer.

parvez.yu 6Mar2008 14:48

Re: Change Icon of EXE file through code extracting it from other EXE file
 
i tried it is so nice


All times are GMT +5.5. The time now is 15:06.