Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Assign Icon

Posted on 2004-10-25
8
Medium Priority
?
1,289 Views
Last Modified: 2009-12-16
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
Comment
Question by:Chester_M_Ragel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 18

Expert Comment

by:armoghan
ID: 12407706
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
 
LVL 18

Expert Comment

by:armoghan
ID: 12407720
also see this article, it is using BeginUpdateResourceW, UpdateResourceW and EndUpdateResourceW API
http://www.codeproject.org/dotnet/dotNetInstaller.asp
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 6

Author Comment

by:Chester_M_Ragel
ID: 12407995
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
 
LVL 18

Expert Comment

by:armoghan
ID: 12408072
0
 
LVL 6

Author Comment

by:Chester_M_Ragel
ID: 12408102
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
 
LVL 18

Accepted Solution

by:
armoghan earned 1000 total points
ID: 12408151
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
 
LVL 6

Author Comment

by:Chester_M_Ragel
ID: 12520464
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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question