GetModuleHandle

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

Syntax

Copy
HMODULE GetModuleHandle(
    [in, optional]    LPCTSTR lpModuleName,
);

Parameters

[in, optional] lpModuleName

The name of the loaded module (either an .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, use backslashes (\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the calling process's address space.

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, it returns a handle to the specified module. If the function fails, it returns 0 (zero). Call GetLastError to get extended error information.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

windows.h

wRTOS_rtss.lib