Class Shell32
Description of Shell32.
Inheritance
Namespace: Dapplo.Windows.Native
Assembly: Dapplo.Windows.dll
Syntax
public static class Shell32 : object
Methods
| Improve this Doc View SourceExtractAssociatedIcon(String, Int32)
Returns an icon representation of an image contained in the specified file. This function is identical to System.Drawing.Icon.ExtractAssociatedIcon, xcept this version works. See: http://stackoverflow.com/questions/1842226/how-to-get-the-associated-icon-from-a-network-share-file
Declaration
public static Icon ExtractAssociatedIcon(string filePath, int iconIndex = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The path to the file that contains an image. |
| System.Int32 | iconIndex | Index of the icon |
Returns
| Type | Description |
|---|---|
| Icon | The System.Drawing.Icon representation of the image contained in the specified file. |
ExtractIconEx(String, Int32, out IntPtr, out IntPtr, Int32)
Get the Icon from a file
Declaration
public static int ExtractIconEx(string sFile, int iIndex, out IntPtr piLargeVersion, out IntPtr piSmallVersion, int amountIcons)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | sFile | |
| System.Int32 | iIndex | |
| IntPtr | piLargeVersion | |
| IntPtr | piSmallVersion | |
| System.Int32 | amountIcons |
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetFileIcon(String, Shell32.IconSize, Boolean)
Returns an icon for a given file extension - indicated by the name parameter. See: http://msdn.microsoft.com/en-us/library/windows/desktop/bb762179(v=vs.85).aspx
Declaration
public static Icon GetFileIcon(string filename, Shell32.IconSize size, bool linkOverlay)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename | Filename |
| Shell32.IconSize | size | Large or small |
| System.Boolean | linkOverlay | Whether to include the link icon |
Returns
| Type | Description |
|---|---|
| Icon | System.Drawing.Icon |
GetFolderIcon(Shell32.IconSize, Shell32.FolderType)
Used to access system folder icons.
Declaration
public static Icon GetFolderIcon(Shell32.IconSize size, Shell32.FolderType folderType)
Parameters
| Type | Name | Description |
|---|---|---|
| Shell32.IconSize | size | Specify large or small icons. |
| Shell32.FolderType | folderType | Specify open or closed FolderType. |
Returns
| Type | Description |
|---|---|
| Icon | System.Drawing.Icon |