Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

IShellItem (Interfaces)
 
.
Summary
Exposes methods that return either icons or thumbnails for Shell items.
Summary
TODO - a short description

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);
    }

[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("43826d1e-e718-42ee-bc55-a1e261c37bfe")]
public interface IShellItem {
    void BindToHandler(IntPtr pbc,
        [MarshalAs(UnmanagedType.LPStruct)]Guid bhid,
        [MarshalAs(UnmanagedType.LPStruct)]Guid riid,
        out IntPtr ppv);

    void GetParent(out IShellItem ppsi);

    void GetDisplayName(SIGDN sigdnName, out IntPtr ppszName);

    void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs);

    void Compare(IShellItem psi, uint hint, out int piOrder);
};

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:

SIZE

SIIGBF

<ComImport()> _
<Guid("43826d1e-e718-42ee-bc55-a1e261c37bfe")> _
<InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IShellItem
    Sub BindToHandler(ByVal pbc As IntPtr, _
        <MarshalAs(UnmanagedType.LPStruct)> ByVal bhid As Guid, _
        <MarshalAs(UnmanagedType.LPStruct)> ByVal riid As Guid, _
        ByRef ppv As IntPtr)

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:

    Sub GetParent(ByRef ppsi As IShellItem)

    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);
    Sub GetDisplayName(ByVal sigdnName As SIGDN, ByRef ppszName As IntPtr)

Documentation

    Sub GetAttributes(ByVal sfgaoMask As UInt32, ByRef psfgaoAttribs As UInt32)

    Sub Compare(ByVal psi As IShellItem, ByVal hint As UInt32, ByRef piOrder As Integer)
End Interface

User-Defined Types:

SIGDN

Notes:

None.

Documentation
IShellItem on MSDN

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions