Shell32ExtractIconEx Method

Creates an array of handles to large or small icons extracted from the specified executable file, DLL, or icon file.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Shell32.dll", CharSet = CharSet.Unicode)]
public static int ExtractIconEx(
	string file,
	int uconIndex,
	IntPtr[] hiconLarge,
	IntPtr[] hiconSmall,
	int iconsCount
)

Parameters

file  String
Pointer to a null-terminated string that specifies the name of an executable file, DLL, or icon file from which icons will be extracted.
uconIndex  Int32
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.

If this value is –1 and hiconLarge and hiconSmall are both , the function returns the total number of icons in the specified file.

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.

hiconLarge  IntPtr
Pointer to an array of icon handles that receives handles to the large icons extracted from the file.

If this parameter is , no large icons are extracted from the file.

hiconSmall  IntPtr
Pointer to an array of icon handles that receives handles to the small icons extracted from the file.

If this parameter is , no small icons are extracted from the file.

iconsCount  Int32
The number of icons to extract from the file.

Return Value

Int32
If the nIconIndex parameter is -1, the hiconLarge parameter is , and the hiconSmall parameter is , 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

See Also