Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.62 KB

ExtractIcon.md

File metadata and controls

61 lines (42 loc) · 1.62 KB

Home

Function name : ExtractIcon

Group: Icon - Library: shell32


Retrieves a handle to an icon from the specified executable file, dynamic-link library (DLL), or icon file.


Code examples:

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

Declaration:

HICON ExtractIcon(
  HINSTANCE hInst,          // instance handle
  LPCTSTR lpszExeFileName,  // file name
  UINT nIconIndex           // icon index
);  

FoxPro declaration:

DECLARE INTEGER ExtractIcon IN shell32;
	INTEGER hInst,;
	STRING  lpszExeFileName,;
	INTEGER lpiIcon  

Parameters:

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.


Return value:

The return value is a handle to an icon, otherwise it is NULL.


Comments:

You must destroy the icon handle returned by ExtractIcon by calling the DestroyIcon function.

See also: ExtractAssociatedIcon, GetIconInfo, SHGetStockIconInfo.