Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 321
flyout Avatar asked Jun 07 '10 14:06

flyout


People also ask

How do I change the icon of an EXE file?

Right-click the original EXE file (not the copy you made) and choose “Open using Resource Hacker.” In the Resource Hacker window, select the “Icon” folder in the left pane. Click the “Action” menu and then select “Replace Icon.”


1 Answers

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

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

like image 169
SLaks Avatar answered Oct 04 '22 20:10

SLaks