IShellIcon::GetIconOfIShellIcon::GetIconOf*
*



Contents  *



Index  *Topic Contents
*Previous Topic: IShellIcon
*Next Topic: IShellLink

IShellIcon::GetIconOf


HRESULT GetIconOf(
    LPCITEMIDLIST pidl,
    UINT flags,
    LPINT lpIconIndex
   );	

Retrieves an icon for an object inside a specific folder.

pidl
Address of the ITEMIDLIST structure that specifies the relative location of the folder.
flags
Flags specifying how the icon is to display. This parameter can be zero or one of the following values:
GIL_FORSHELL The icon is to be displayed in a shell folder.
GIL_OPENICON The icon should be in the open state if both open- and closed-state images are available. If this flag is not specified, the icon should be in the normal or closed state. This flag is typically used for folder objects.
lpIconIndex
Address of the index of the icon in 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 extension must be .exe, .com, or .bat)
3 Folder (plain)
4 Folder (open)

If you are unable to get an icon for this object using GetIconOf, use the IShellFolder::GetUIObjectOf method to get an object that supports the IExtractIcon::Extract method.

Notes to Callers

The index returned is from the system image list.

Notes to Implementers

If the icon index used is not one of the standard images listed, it is the implementer's responsibility to add the image to the system image list and then place the index into the lpIconIndex parameter. To prevent the system image list from growing too large, each image should only be added once.

See also IShellIcon


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.