extract icon from dll

extract icon from dll

Post by Daniel W. Browe » Tue, 31 Mar 1998 04:00:00



How do I create an ico file of a single icon contained in a dll or exe file?


 
 
 

extract icon from dll

Post by Daniel W. Browe » Tue, 31 Mar 1998 04:00:00


How do I create an ico file of a single icon contained in a dll or exe file?



 
 
 

extract icon from dll

Post by ProFinanc » Tue, 31 Mar 1998 04:00:00


It's much more interresting if you succeed to place a 'WEP' to!
(c code required to load the dll as module)

I'm interrested if anyone has done this (not using an c compiler)

Daniel W. Brower heeft geschreven in bericht ...

>How do I create an ico file of a single icon contained in a dll or exe
file?



 
 
 

extract icon from dll

Post by Larry Serflate » Wed, 01 Apr 1998 04:00:00



> How do I create an ico file of a single icon contained in a dll or exe file?

Tough question, I have been troubled by this for over a year!  The APIs
involved include:

Private Declare Function CopyIcon% Lib "User" (ByVal hInst%, ByVal hIcon%)
Private Declare Function DestroyIcon% Lib "User" (ByVal hIcon%)
Private Declare Function DrawIcon% Lib "User" (ByVal hDC%, ByVal X%, ByVal Y%, ByVal hIcon%)
Private Declare Function ExtractIcon% Lib "Shell" (ByVal hInst%, ByVal lpFile$, ByVal hIcon%)

But I can't seem to find the right mix to be able to assign an icon to a
Form.Icon, or a DragIcon, which is what I tried to do.  Once assigned, it could
be saved using SavePicture.

 
 
 

extract icon from dll

Post by Steve Bonann » Wed, 01 Apr 1998 04:00:00


I have been able to extract an icon from an exe or dll and assign it to a
button. If you think this will help e-mail me and I'll send you the code I
used.

Steve



>> How do I create an ico file of a single icon contained in a dll or exe
file?

>Tough question, I have been troubled by this for over a year!  The APIs
>involved include:

>Private Declare Function CopyIcon% Lib "User" (ByVal hInst%, ByVal hIcon%)
>Private Declare Function DestroyIcon% Lib "User" (ByVal hIcon%)
>Private Declare Function DrawIcon% Lib "User" (ByVal hDC%, ByVal X%, ByVal
Y%, ByVal hIcon%)
>Private Declare Function ExtractIcon% Lib "Shell" (ByVal hInst%, ByVal

lpFile$, ByVal hIcon%)
Quote:

>But I can't seem to find the right mix to be able to assign an icon to a
>Form.Icon, or a DragIcon, which is what I tried to do.  Once assigned, it
could
>be saved using SavePicture.

 
 
 

extract icon from dll

Post by Cypher-88 » Thu, 02 Apr 1998 04:00:00


Steve Bonanno a crit dans le message ...
|I have been able to extract an icon from an exe or dll and assign it to a
|button. If you think this will help e-mail me and I'll send you the code I
|used.

YES
SEND it to me too, please

 
 
 

extract icon from dll

Post by Cypher-88 » Thu, 02 Apr 1998 04:00:00


|I have been able to extract an icon from an exe or dll and assign it to a
|button. If you think this will help e-mail me and I'll send you the code I
|used.

YES
Send it to me too, please

 
 
 

extract icon from dll

Post by NealD » Fri, 03 Apr 1998 04:00:00


If you are just trying to get and save the image, you can use an icon
editor such as IconForge. The trial download can be found at
http://www.cursorarts.com/ca_if.html or from other major on-line libraries.



> How do I create an ico file of a single icon contained in a dll or exe
file?



 
 
 

extract icon from dll

Post by Arthur Mark » Sun, 05 Apr 1998 04:00:00


This is extracted from a sample I got at
Use the API viewer to get the declares and constants

Public Const BASIC_SHGFI_FLAGS = SHGFI_TYPENAME _
   Or SHGFI_SHELLICONSIZE Or SHGFI_SYSICONINDEX _
   Or SHGFI_DISPLAYNAME Or SHGFI_EXETYPE

Dim shinfo As SHFILEINFO

    hImgSmall = SHGetFileInfo(fName, 0&, shinfo, Len(shinfo), _
                 BASIC_SHGFI_FLAGS Or SHGFI_SMALLICON)
    hImgLarge = SHGetFileInfo(fName, 0&, shinfo, Len(shinfo), _
                 BASIC_SHGFI_FLAGS)

    pixSmall.Picture = LoadPicture()
    pixSmall.AutoRedraw = True
    pixLarge.Picture = LoadPicture()
    pixLarge.AutoRedraw = True

    r = ImageList_Draw(hImgSmall&, shinfo.iIcon, pixSmall.hdc, 0, 0,
ILD_TRANSPARENT)
    r = ImageList_Draw(hImgLarge, shinfo.iIcon, pixLarge.hdc, 0, 0,
ILD_TRANSPARENT)
    pixSmall.Picture = pixSmall.Image
    pixLarge.Picture = pixLarge.Image

Art


> Steve Bonanno a crit dans le message ...
> |I have been able to extract an icon from an exe or dll and assign it to a
> |button. If you think this will help e-mail me and I'll send you the code I
> |used.

> YES
> SEND it to me too, please

 
 
 

extract icon from dll

Post by Arthur Mark » Sun, 05 Apr 1998 04:00:00


I left out the source to that code...

    http://home.sprynet.com/sprynet/rasanen/vbnet/default.htm