IShellIconGetIconOf Method

Gets an icon for an object inside a specific folder.

If you are unable to retrieve an icon for an object using GetIconOf(PIDL, GetIconLocationFlags, Int32), use the GetUIObjectOf(IntPtr, UInt32, IntPtr, Guid, IntPtr) method to retrieve an object that supports the Extract(String, UInt32, IntPtr, IntPtr, UInt32) / Extract(String, UInt32, IntPtr, IntPtr, UInt32) function.

Definition

Namespace: DevCase.Win32.Interfaces
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[PreserveSigAttribute]
HResult GetIconOf(
	PIDL pidl,
	GetIconLocationFlags flags,
	ref int refIconIndex
)

Parameters

pidl  PIDL
The address of the ITEMIDLIST structure that specifies the relative location of the folder.
flags  GetIconLocationFlags
Flags specifying how the icon is to display. This parameter can be Null.

The icon should be in the open state if both open-state and closed-state images are available.

refIconIndex  Int32
Recceives the address of the index of the icon in the system image list.

Note to Calling Applications: the icon index returned is from the system image list.

The following standard image list indexes can be returned:

0: Document (blank page, not associated)

1: Document (with data on the page)

2: Application (file name extension must be .exe, .com, or .bat)

3: Folder (plain)

4: Folder (open)

Return Value

HResult
Returns S_OK if lpIconIndex contains the correct system image list index, or S_FALSE if an icon can't be obtained for this object.

Note to Calling Applications: The icon index returned is from the system image list.

Remarks

See Also