Name

FindHInstance Function

Syntax

function FindHInstance(Ref: Pointer): LongInt;

Description

FindHInstance returns the instance handle of the module that contains the given code pointer. The module might be the application, a DLL, or a runtime package that the application or DLL loads. If the pointer is not a valid code pointer, FindHInstance returns zero.

Feel free to call FindHInstance or FindClassHInstance, whichever is more convenient. FindHInstance is a real function.

Tips and Tricks

Earlier releases of Delphi required you to call FindHInstance to get the instance handle for a package. The current release lets you use the HInstance variable, so there is little need for FindHInstance in most applications.

See Also

FindClassHInstance Function, FindResourceHInstance Function, HInstance Variable, MainInstance Variable

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.