Solved

Assign Icon

Posted on 2004-10-25
1,241 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
Question by:Chester_M_Ragel
    8 Comments
     
    LVL 18

    Expert Comment

    by:armoghan
    0
     
    LVL 18

    Expert Comment

    by:armoghan
    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
    also see this article, it is using BeginUpdateResourceW, UpdateResourceW and EndUpdateResourceW API
    http://www.codeproject.org/dotnet/dotNetInstaller.asp
    0
     
    LVL 6

    Author Comment

    by:Chester_M_Ragel
    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
    0
     
    LVL 6

    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Anonabox PRO Tor & VPN Router

    PRO is the most advanced way to fortify your privacy and online anonymity by layering the Tor network with VPN services. Use both together or separately, and without needing to download software onto your devices.

    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    911 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now