ExtractIconEx (Compact 2013)

3/28/2014

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

Syntax

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 or DLL file from which to extract icons.
  • 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.

    The nIconIndex parameter must be zero or -N, where N is a specified resource identifier. The nIcons parameter must be 1.

  • phiconLarge
    [in, out] Pointer to an array to receive handles to large icons extracted from the file. If this parameter is NULL, no large icons are extracted from the file.
  • phiconSmall
    [in, out] Pointer to an array to receive handles to 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. The nIcons parameter must be 1.

Return Value

This function returns the handle to the first icon in the retrieved icon array. If both phiconLarge and phiconSmall are not NULL, the return value defaults to the first large icon.

Remarks

Your application must destroy all icons extracted by this function by calling the DestroyIcon function for each icon. Note that destruction of all the icons in the retrieved array also destroys the returned icon.

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

Requirements

Header

shellapi.h

See Also

Reference

Resources Functions
DestroyIcon
GetSystemMetrics