flyout
flyout

Reputation: 497

How to change executable icon from c# code? (not my app icon)

How can I change *.EXEs icons from c# code (not my main app icon but from that app i want to change the icon of another exe).

I eventually would have to change the icons for A LOT of files so I am looking for a fast and good performance way to do it.

I have been googling for 30min but all I found is how to set the icon for the app in VS.

Upvotes: 7

Views: 6246

Answers (3)

Polyfun
Polyfun

Reputation: 9639

Rather than hacking the resource in the .exe (not very friendly), you could instead create a shortcut to the exe, which will allow you to easily use your own icon in the shortcut. See here for more info on how to do this, using the ShellLink class.

Upvotes: 0

IsmailS
IsmailS

Reputation: 10863

See this. http://www.angusj.com/resourcehacker/

It is definitely not through C# but its eventually fast and good performance way as you asked.

EDIT
All About Resource Hacker in a Brief Tutorial

Upvotes: 0

SLaks
SLaks

Reputation: 888047

You need to call the Resources API methods, as described here.

Specifically, you need to call BeginUpdateResource, UpdateResource, and EndUpdateResource.

Upvotes: 5

Related Questions