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.0
Syntaxpublic static IntPtr GetFileIcon(
string filePath,
Shell32FileAttributes iconAttributes
)
Public Shared Function GetFileIcon (
filePath As String,
iconAttributes As Shell32FileAttributes
) As IntPtr
public:
static IntPtr GetFileIcon(
String^ filePath,
Shell32FileAttributes iconAttributes
)
static member GetFileIcon :
filePath : string *
iconAttributes : Shell32FileAttributes -> IntPtr
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:
IntPtrAn
IntPtr handle to the Shell icon that represents the file, or IntPtr.Zero on failure.
RemarksCaller is responsible for destroying this handle with DestroyIcon() when no longer needed.
See Also