Changing executable's icon.

  • Thread starter Thread starter Yevgeny
  • Start date Start date
Y

Yevgeny

Hi everyone!
I have question about changing icon of executable.
I have to write program (if I can) which will change icon of existing executable.
I can change this during development in VS:
Project/Properties/CommonProperties/General/ApplicationIcon.

I am wondering if I can do that like this:
1) Read .exe
2) Read resources.
3) Change icon.
4) Write resources.
5) Write exe.

I thought that I can use stuff like that:
Assembly assembly = Assembly.LoadFrom(fileName);
ArrayList arrayList = new ArrayList(assembly.GetManifestResourceNames());

I hoped that I will see ApplicationIcon in arrayList, but it is not.

How can I get it? How can I change it? How can I update .exe?

Thanks in advance.
 
Hi,

The app icon is an unmanaged resource IIRC. Therefore, you cannot use the
managed means to work with that resources, you will have to read the exe
file as binary, locate the resource, update its content and write the
modified file back to disk.
 
Back
Top