Home 
  
  
 Change View 
  
  
 Print 
  
Microsoft Windows CE 3.0  

ExtractIconEx

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function retrieves the handle from the specified executable file or dynamic-link library (DLL).

HICON
ExtractIconEx(
LPCTSTR
lpszFile,

int
nIconIndex,

HICON
FAR
*
phiconLarge,

HICON
FAR
*
phiconSmall,

UINT
nIcons
);

Parameters

lpszFile
[in] Long pointer to a null-terminated string that specifies the name of an executable file, DLL, or icon file from which icons will be extracted.
nIconIndex
[in] Specifies the zero-based index of the first icon to extract. For example, if this value is zero, the function extracts the first icon in the specified file.

For Windows CE versions 2.10 and later, the nIconIndexparameter must be zero or –N, where N is a specified resource identifier. The nIconsparameter must be 1.

For Windows CE versions 1.0 through 2.01, the function returns the total number of icons in the specified file if nIconIndexis –1 and phIconLargeand phiconSmallare both NULL. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ICO file, the return value is 1.

phiconLarge
[out] Pointer to an array of icon handles which receives handles to the large icons extracted from the file. If this parameter is NULL, no large icons are extracted from the file.
phiconSmall
[out] Pointer to an array of icon handles which receives handles to the small icons extracted from the file. If this parameter is NULL, no small icons are extracted from the file.
nIcons
[in] Specifies the number of icons to extract from the file.

Return Values

For Windows CE versions 2.10 and later, this function returns the handle to an icon. If both phiconLargeand phiconSmallare not NULL, the return value defaults to the large icon.

For Windows CE versions 1.0 through 2.01, this function returns a UINTdata type. If the nIconIndexparameter is –1, the phiconLargeparameter is NULL, and the phiconSmallparameter is NULL, then the return value is the number of icons contained in the specified file. Otherwise, the return value is the number of icons successfully extracted from the file.

Remarks

You must destroy all icons extracted by ExtractIconExby calling the DestroyIconfunction.

To retrieve the dimensions of the large and small icons, use the GetSystemMetricsfunction with the SM_CXICON, SM_CYICON, SM_CXSMICON, and SM_CYSMICON flags.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Shellapi.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

DestroyIcon, GetSystemMetrics