Group: Icon - Library: shell32
Retrieves a handle to an icon from the specified executable file, dynamic-link library (DLL), or icon file.
How to view icons stored in executable files (Icon Viewer) - II
How to view icons stored in executable files (Icon Viewer)
GDI+: Storing DLL icon resources in image files
HICON ExtractIcon(
HINSTANCE hInst, // instance handle
LPCTSTR lpszExeFileName, // file name
UINT nIconIndex // icon index
);
DECLARE INTEGER ExtractIcon IN shell32;
INTEGER hInst,;
STRING lpszExeFileName,;
INTEGER lpiIcon
hInst [in] Handle to the instance of the application calling the function.
lpszExeFileName [in] Pointer to a null-terminated string specifying the name of an executable file, DLL, or icon file.
nIconIndex [in] Specifies the zero-based index of the icon to retrieve.
The return value is a handle to an icon, otherwise it is NULL.
You must destroy the icon handle returned by ExtractIcon by calling the DestroyIcon function.
See also: ExtractAssociatedIcon, GetIconInfo, SHGetStockIconInfo.