Click or drag to resize

Shell32GetFileIcon Method

Gets an IntPtr handle to the Shell icon that represents the file.

Namespace:  Alphaleonis.Win32.Filesystem
Assembly:  AlphaFS (in AlphaFS.dll) Version: 2.2
Syntax
public static IntPtr GetFileIcon(
	string filePath,
	Shell32FileAttributes iconAttributes
)

Parameters

filePath
Type: SystemString
The path to the file system object which should not exceed maximum path length. Both absolute and relative paths are valid.
iconAttributes
Type: Alphaleonis.Win32.FilesystemShell32FileAttributes
Icon size SmallIcon or LargeIcon. Can also be combined with AddOverlays and others.

Return Value

Type: IntPtr
An IntPtr handle to the Shell icon that represents the file, or IntPtr.Zero on failure.
Remarks
Caller is responsible for destroying this handle with DestroyIcon() when no longer needed.
See Also