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 26Feb2010 16:14

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

Originally Posted by VijayLaxmi (Post 64773)
I also want to do this,i m already taking help of this thread but its not working.
t think you done it so please provide me sample to change icon to exe.
thanks.

What is not working for you

VijayLaxmi 26Feb2010 16:18

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Icon not replaced on EXE file.

shabbir 26Feb2010 16:23

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Did you try the exact steps I mentioned because I downloaded the samples and saw that its working.

Also remember that you have more than one icon in many executable's and you may need to change each of them

VijayLaxmi 26Feb2010 16:31

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Yes i use the sample exactly.actually i m working on Vista i dont think its generate any issue.
please help me for this.
thanks.

PyroStrex 22Mar2010 21:02

Re: Change Icon of EXE file through code extracting it from other EXE file
 
Well, sorry if what i will be asking is not suite for this topic but how about String table? Can you give me some hint? Sorry again.

abcdark 12Feb2012 20:44

Re: Change Icon of EXE file through code extracting it from other EXE file
 
I didnt use the sample code. I copied the function onbuttonchangeicon() and modified the variables and used it in a console program. It succesfully changes icons for certain executables but not all. Anyways, the problem that bugs me is that if you copy the exe file to another location then the new icon is not visible. The old icon comes back. and if u again copy back the file into the original folder where it was initially, then it again regains the icon. So icon is not "locked" to the exe. Wht to do ??

shabbir 13Feb2012 08:44

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

Originally Posted by abcdark (Post 92240)
I didnt use the sample code. I copied the function onbuttonchangeicon() and modified the variables and used it in a console program. It succesfully changes icons for certain executables but not all. Anyways, the problem that bugs me is that if you copy the exe file to another location then the new icon is not visible. The old icon comes back. and if u again copy back the file into the original folder where it was initially, then it again regains the icon. So icon is not "locked" to the exe. Wht to do ??

There are multiple size icons in an exe and the code changes only one and so when you copy, you may be seeing different icon size. It is locked into the exe and you can verify that with Resource Hacker as well

bit8bug 24Feb2013 21:15

Re: Change Icon of EXE file through code extracting it from other EXE file
 
1 Attachment(s)
Hi shabbir
I downloaded the source code , in the file ExeUpdatesDlg line 227 why you are looping the destination exe ?
I followed your tutorial but the icons are getting corrupted
I have the code attached :crazy:
GetLastError() is always returning zero - NO ERRORS -

shabbir 25Feb2013 09:59

Re: Change Icon of EXE file through code extracting it from other EXE file
 
The looping is because you can have multiple icons in the executable.


All times are GMT +5.5. The time now is 05:24.