ExtractIcon

  HICON ExtractIcon(hInst, lpszExeName, nIconIndex)    
  HANDLE hInst;    
  LPSTR lpszExeName;    
  WORD nIconIndex;    

The ExtractIcon function retrieves the handle of an icon from a specified executable file, dynamic-link library, or icon file.

Parameters

hInst

Identifies the instance of the application calling the function.

lpszExeName

Points to a null-terminated string specifying the name of an executable file, dynamic-link library, or icon file.

nIconIndex

Specifies the index of the icon to retrieve. If this value is zero, the function returns the handle of the first icon in the specified file. If this value is -1, the function returns the total number of icons in the specified file.

Return Value

The return value is the handle of an icon if function is successful. If the return value is 1, the file specified in the lpszExeName parameter was not an executable file, dynamic-link library, or icon file. If the return value is NULL, no icons were found in the file.