Root > Reference > All Functions > GetFileIcon

Function GetFileIcon

Previous pageReturn to chapter overviewNext page   

Gets executable file's icon.

 

Unit

ESysInfo

 

Syntax

 

Code (Delphi)

function GetFileIcon(

const ADPI: Integer;

const AFileName: String;

ALarge: Boolean;

ASz: PSize;

const AIconName: UnicodeString = '';

const ALoadFromRCData: Boolean = False

): HICON;

 

Parameters

ADPI [in, optional]

DPI settings (96, 120, etc.). Pass 0 to use defaults.

 

AFileName [in]

Full executable file name (.exe, .dll, .bpl).

 

ALarge [in]

True - extract large icon, False - extract small icon.

 

Icon sizes are determinated from system settings and DPI. Usually it's values like 40x40 or 32x32 for large size and 20x20 or 16x16 for small size.

 

ASz [out, optional]

Actual icon size in pixels. Caller may use this value for rendering resulting icon.

 

This value is undefined if function fails.

 

Return value

If the function succeeds, the return value is default icon's handle of the specified file.

 

If the function fails, the return value is zero. To get extended error information, call  GetLastError.

 

Remarks

Creates handle to large or small icon extracted from the specified executable file, DLL, or package.

 

You must destroy all icons extracted by GetFileIcon by calling the  DestroyIcon function.




Send feedback... Build date: 2023-09-11
Last edited: 2023-09-11
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_esysinfo_getfileicon.php