SHFILEINFOA structure (shellapi.h)

Contains information about a file object.

Syntax

typedef struct _SHFILEINFOA {
  HICON hIcon;
  int   iIcon;
  DWORD dwAttributes;
  CHAR  szDisplayName[MAX_PATH];
  CHAR  szTypeName[80];
} SHFILEINFOA;

Members

hIcon

Type: HICON

A handle to the icon that represents the file. You are responsible for destroying this handle with DestroyIcon when you no longer need it.

iIcon

Type: int

The index of the icon image within the system image list.

dwAttributes

Type: DWORD

An array of values that indicates the attributes of the file object. For information about these values, see the IShellFolder::GetAttributesOf method.

szDisplayName[MAX_PATH]

Type: TCHAR[MAX_PATH]

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

szTypeName[80]

Type: TCHAR[80]

A string that describes the type of file.

Remarks

This structure is used with the SHGetFileInfo function.

Note

The shellapi.h header defines SHFILEINFO as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header shellapi.h