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

SHFILEINFO (Structures)
 
.
Summary
Contains information about a file object.

C# Signature:

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
struct SHFILEINFO {
    public IntPtr hIcon;
    public int iIcon;
    public IntPtr iIcon;
    public uint dwAttributes;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
    public string szDisplayName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
    public string szTypeName;
}

VB Signature:

Structure SHFILEINFO
    Public hIcon As IntPtr
    Public iIcon As Integer
    Public dwAttributes As Integer
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> _
    Public szDisplayName As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
    Public szTypeName As String
End Structure

User-Defined Field Types:

None.

Notes:

Used by the SHGetFileInfo.

None.

Properties:

hIcon

Handle to the icon that represents the file.

iIcon

Index of the icon image within the system image list.

dwAttributes

Array of values that indicates the attributes of the file object.

szDisplayName

String that contains the name of the file as it appears in the Microsoft Windows Shell, or the path and file name of the file that contains the icon representing the file.

szTypeName

String that describes the type of file.

Editions:

Changed from Definition to Signature in order to display them in the PInvoke.net Visual Studio Add-In.

Changed C# definition of iIcon from IntPtr to int, because IntPtr is the wrong type and messes it all up on the Windwos 64bit platform.

Documentation
SHFILEINFO 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