ImageEn, unit iexShellThumbnails

WindowsGetFileIcon


Declaration

function WindowsGetFileIcon(const Filename : String; var aIcon : TIcon; IconSize : Cardinal = SHIL_JUMBO) : Boolean; overload;
function WindowsGetFileIcon(const Filename : string; DestBitmap : TIEBitmap; IconSize : Cardinal = SHIL_JUMBO) : Boolean; overload;


Description

Returns the icon for the specified file, either as a TIEBitmap or a TIcon.

Values of IconSize:
Item Description
SHIL_SMALL ($01) Images are Shell standard small icon size of 16x16
SHIL_LARGE ($00) Image size is normally 32x32 pixels or 48x48 pixels
SHIL_EXTRALARGE ($02) Images are the Shell standard extra-large icon size, which is typically 48x48
SHIL_JUMBO ($04) Image size is normally 256x256 pixels
SHIL_SYSSMALL ($03) Image size is specified by GetSystemMetrics called with SM_CXSMICON and GetSystemMetrics called with SM_CYSMICON

Result is false if the icon cannot be retrieved.


Example

// Return a high-quality icon for Notepad
WindowsGetFileIcon( 'C:\Windows\notepad.exe', ImageEnView1.IEBitmap, SHIL_JUMBO );
ImageEnView1.Update();


See Also

 WindowsGetExplorerThumbnail
 WindowsGetStockIcon
 WindowsGetSystemImageList