IShellItemImageFactory (Interfaces)
Last changed: olenikm@gmail.com-76.189.212.160

.
Summary
Exposes methods that return either icons or thumbnails for Shell items.

C# Definition:

    [ComImportAttribute()]
    [GuidAttribute("bcc18b79-ba16-442f-80c4-8a59c30c463b")]
    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IShellItemImageFactory
    {
        void GetImage(
        [In, MarshalAs(UnmanagedType.Struct)] SIZE size,
        [In] SIIGBF flags,
        [Out] out IntPtr phbm);
    }

VB Definition:

    <ComImportAttribute(),  _
    GuidAttribute("bcc18b79-ba16-442f-80c4-8a59c30c463b"),  _
    InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)>  _
    Public Interface IShellItemImageFactory    

        Sub GetImage(ByVal size As SIZE, ByVal flags As SIIGBF, ByRef phbm As IntPtr)
    End Interface

User-Defined Types:

SIIGBF

Notes:

To get a thumbnail for a shell item, simply cast the IShellItem instance to IShellItemImageFactory and call GetImage() on it. Usage may look something like this:

    IShellItem ppsi = null;
    IntPtr hbitmap = IntPtr.Zero;
    // GUID of IShellItem.
    Guid uuid = new Guid("43826d1e-e718-42ee-bc55-a1e261c37bfe");
    SHCreateItemFromParsingName(filename, IntPtr.Zero, uuid, out ppsi);
    ((IShellItemImageFactory)ppsi).GetImage(new SIZE(256, 256), 0x0, out hbitmap);

Documentation