SAMPLE: Code to Extract an Icon from a Windows .EXE FileLast reviewed: April 7, 1997Article ID: Q70073 |
3.00 3.10
WINDOWS
kbprg kbfile
The information in this article applies to:
SUMMARYWINRES is a file in the Microsoft Software Library that provides the necessary structures to extract an icon from a Windows .EXE file. NOTE: In Windows version 3.1 there is a new function named ExtractIcon() in SHELL.DLL that performs this type of functionality. However, this article and sample still provide a useful example of extracting .EXE file information. Download WINRES.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
MORE INFORMATIONThe following is a list of the files in the WINRES archive and how each is used:
Filename Description -------- ----------- WINRES.C Application to extract .ICO and .EXE resource information WINOPEN.C Used to display FileOpen dialog box and retrieve the filename DUMPRES.H .EXE header information derived from the "MS-DOS Encyclopedia" (Microsoft Press) Program Theory of OperationTo retrieve the icons from an .ICO or .EXE file, the program must retrieve the device independent bitmaps (DIBs) that make up the icon. Although this is a difficult process, the necessary information is documented in the "MS- DOS Encyclopedia." A comment with each structure in the DUMPRES.H file provides a cross-reference to the relevant information in the "MS-DOS Encyclopedia." The .ICO file format is documented in Chapter 9, "File Formats," in version 3.0 of the "Microsoft Windows Software Development Kit Reference Volume 2."
Potential Enhancements to the Code
Differences Between .ICO Files and .EXE ResourcesThere are only three differences between an icon in an .ICO file and one in an .EXE file:
|
Additional reference words: 3.00 3.10 softlib WINRES.EXE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |