[comp.windows.ms] Getting Icons from DLL

opergb@uvm.edu (Gary Bushey) (12/08/90)

Now that I can load icons I was wondering if there was a way to retrieve
icons from a DLL file so that I may use them one at a time instead of having
to go through all of the icons in the file?

advTHANKSance

Gary Bushey
opergb@newton.uvm.edu

ntaib@silver.ucs.indiana.edu (Nur Iskandar Taib) (12/11/90)

>Now that I can load icons I was wondering if there was a way to retrieve
>icons from a DLL file so that I may use them one at a time instead of having
>to go through all of the icons in the file?


Speaking of which: is there a way to combine all those 
.ico files (can never remember what they're called!) 
into a .DLL file?


-------------------------------------------------------------------------------
Iskandar Taib                        | The only thing worse than Peach ala
Internet: NTAIB@AQUA.UCS.INDIANA.EDU |    Frog is Frog ala Peach
Bitnet:   NTAIB@IUBACS               !

bturner@hpcvlx.cv.hp.com (Bill Turner) (12/12/90)

>>Now that I can load icons I was wondering if there was a way to retrieve
>>icons from a DLL file so that I may use them one at a time instead of having
>>to go through all of the icons in the file?
>
>Speaking of which: is there a way to combine all those 
>.ico files (can never remember what they're called!) 
>into a .DLL file?

Yes, and Yes.

First, to put icons into a DLL you specify them in the .RC file for the DLL.
(The only way to put them into a DLL is to use RC to stuff 'em in.)  The
process is just the same as for puting resources into an .EXE file.

Second, to use them, you can use the following:  (*warning, this is Windows
2.0 code, since I don't do 3.0 dev I don't know if these have changed
slightly or not...)

    hLib = LoadLibrary(lpLibFileName);
/* 
 *  or
 * 
 *  hLib = GetModuleHandle(lpLibFileName);
 *
 *  if the library is already loaded
 */
    hIcon = LoadIcon(hLib, lpIconName);

Be aware that keeping the icon handle after the library is unloaded can
cause problems....

--Bill Turner (bturner@hp-pcd.cv.hp.com)
HP Interface Technology Operation

hans@pine.circa.ufl.edu (Hans van Oostrom) (12/12/90)

In article <1990Dec7.192958.5023@uvm.edu>, opergb@uvm.edu (Gary Bushey) writes...
>Now that I can load icons I was wondering if there was a way to retrieve
>icons from a DLL file so that I may use them one at a time instead of having
>to go through all of the icons in the file?
> 
>advTHANKSance
> 
>Gary Bushey
>opergb@newton.uvm.edu

There was a posting on comp.binaries.ibm.pc called viewicon that 
extracts icons from any file, or puts it in any file.  Funny thing is 
that it is NOT a windows program.  Also the program thinks that I 
don't have a EGA or VGA card and does not work, but somebody else got 
it working on a VGA. Check it out.  If there is a lot of interest I 
can upload it to cica.

Hans van Oostrom
PO Box J-254, JHMHC                 hans@ufpine                (BITNET)
Gainesville, FL  32601, USA         hans@pine.circa.ufl.edu    (INTERNET)

ccfac@nt.sait.edu.au (12/28/90)

In article <1990Dec7.192958.5023@uvm.edu>, opergb@uvm.edu (Gary Bushey) writes:
> Now that I can load icons I was wondering if there was a way to retrieve
> icons from a DLL file so that I may use them one at a time instead of having
> to go through all of the icons in the file?
>
> advTHANKSance
>
> Gary Bushey
> opergb@newton.uvm.edu

If you use geticon.exe, you should be able to extract all or selective icons
into .ICO files, which you can use ICONDRAW or SDKPAINT to modify and use in
Windows.  Geticon.exe can be found in cica.cica.indiana.edu under the name
ViewIcon.Zip (I think)  ViewIcon and PutIcon is included in the ZIP which
does exactly as the name implies.  These files are great icon utilities!
A Must!

Cheers..
Francis Chan--
-------------------------------------------------------------------------------
CCFAC@SAIT.EDU.AU       Francis Chan
University of South Australia (to be)
-------------------------------------------------------------------------------

ccfac@nt.sait.edu.au (12/28/90)

In article <77464@iuvax.cs.indiana.edu>, ntaib@silver.ucs.indiana.edu (Nur Iskandar Taib) writes:
>>Now that I can load icons I was wondering if there was a way to retrieve
>>icons from a DLL file so that I may use them one at a time instead of having
>>to go through all of the icons in the file?
>
>
> Speaking of which: is there a way to combine all those
> .ico files (can never remember what they're called!)
> into a .DLL file?
>
>
> -------------------------------------------------------------------------------
> Iskandar Taib                        | The only thing worse than Peach ala
> Internet: NTAIB@AQUA.UCS.INDIANA.EDU |    Frog is Frog ala Peach
> Bitnet:   NTAIB@IUBACS               !


If you use PutIcon.exe which came with ViewIcon.Zip, you can overwrite some of
the icons in the .DLL file with your favorite .ico.  ViewIcon.Zip can be
obtained from Cica.cica.indiana.edu or some other favorite FTP sites.

Cheers
Francis Chan--
-------------------------------------------------------------------------------
CCFAC@SAIT.EDU.AU       Francis Chan
University of South Australia (to be)
-------------------------------------------------------------------------------