PDA

View Full Version : [HowTo]Change the icon of a foreign exe?



"BumbleBee"
24th April 2011, 12:02
What I want to do,is:
1)open a file dialog,select an icon.
2)open a file dialog,select the exe
3)push a button "change icon" and change the icon of that program.

I read about changing icons,but all I find is how to chnage the icon of the current app..

Thank you.

squidge
24th April 2011, 12:30
This should really be in general programming as it's nothing to do with Qt.

But this is basically what you need to do:

1) Download the PE specification: http://msdn.microsoft.com/en-us/windows/hardware/gg463119

2) Open your EXE file & Load the PE directory.

3) Open the "Resources" directory

4) In there you'll see the "Icon" entry. Replace this with what you want.

5) Save the EXE.

Note that you can't just change bytes as the replacement icon might not be the same size as the current one.