Root > Reference > All Functions > GetModuleType

Function GetModuleType

Previous pageReturn to chapter overviewNext page   

Returns type of loaded executable module, based on analyzing its file header.

 

Unit

EAppType

 

Syntax

 

Code (Delphi)

function GetModuleType(

const AInstance: HMODULE = 0

): TModuleType;

 

Parameters

AInstance [in, optional]

Module handle to analyze. Default (0) means current module.

 

Be careful with using 0 in packaged application. It's always better to explicitly specify required module.

 

Return value

Type of the AInstance module. It is TModuleType.mtProgram, TModuleType.mtLibrary or TModuleType.mtPackage on success and TModuleType.mtUnknown on error.

 

Remarks

 

Tip

This is routine from low-level unit. Do not use this unit unless you need to extend or alter EurekaLog behavior.

 

This function analyzes PE header of loaded executable and return its type: EXE, DLL or BPL.

 

Function doesn't cache results and perform checking on each call.

 

There are also simple wrappers for more easy access. For example, IsEXE, IsDLL and so on. See EAppType unit for more info.

 

See also




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_eapptype_getmoduletype.php