• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1295
  • Last Modified:

Assign Icon

I want to get the icon from one exe file and assign it to another using win32 api (beginupdateresource, updateresource, endupdateresource) or some other way. I want to do it in run time. Updateresource is working for text kind of resources. But when i try to do it for icon, the new exe file says the format is not correct or something. Can anyone help me on this?

Thank you,
Chester.
0
Chester_M_Ragel
Asked:
Chester_M_Ragel
  • 5
  • 3
1 Solution
 
armoghanCommented:
Above link is to get the icon of an Exe
for assigning some exe another icon
see this link, it is in delphi but you may be able to use the DLL
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20598186.html
0
 
armoghanCommented:
also see this article, it is using BeginUpdateResourceW, UpdateResourceW and EndUpdateResourceW API
http://www.codeproject.org/dotnet/dotNetInstaller.asp
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Chester_M_RagelAuthor Commented:
Hi Moghan,

I don't want to use some other dll to do this stuff. I went thro Mad* s MadRes (delphi one).. But i think it must be possible to do it without using that, by just using windows api. Also I want to assign an icon in file1.exe to file2.exe. Normally I can add resource with updateresource. But when it comes to icon(b'cos of compersion which they use) it is giving some problem.
0
 
armoghanCommented:
0
 
Chester_M_RagelAuthor Commented:
Actually I was searching for this for more than two weeks... I went thro all MSDN documentations... I know how to access resources, icons.. the problem is writing them to another file. Actually i can even write them, but when i try that for icons after adding that and try to access the icon, it is saying the resource format is not in correct format....
0
 
armoghanCommented:
sorry :( ,
I have not gone through that much detail, just used once to read the icons. never wrote them.

If you get the solution for the compression problem do post it here as well
0
 
Chester_M_RagelAuthor Commented:
Even though this is not the answer what I actually looked for..... At last I found that can use GROUPICON,ICONDIR and ICONENTRYDIR to get the icons by passing correct icon :(. Even though SHFILEINFO can be used to get System and Shell Icon but not the ID which I really wants. Anyway, I'm going to give you the points b'cos I didn't get any reply from anyone here for some time and I don't have any hope in getting one either. Thanks for your interest.

Chester.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now