GetModuleHandle

The GetModuleHandle function retrieves a module handle for the specified module. The module must have been loaded by the calling process.

Syntax

HMODULE GetModuleHandle(
    LPCTSTR lpModuleName,
);

Parameters

lpModuleName

The name of the loaded module (either a .rtdll or .rtss file). If the file name extension is omitted, the default library extension .rtdll is appended. The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the calling process.

If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.rtss file).

Return Value

If the function succeeds, the return value is a handle to the specified module. 0 (zero) if the function fails

To get extended error information, call GetLastError.

Requirements

Minimum Supported Version RTX64 2013
Header windows.h
Library Rtx_Rtss.lib