#include <toolhelp.h> |
HMODULE ModuleFindName(lpme, lpszName) | |||||
MODULEENTRY FAR* lpme; | /* address of MODULEENTRY structure | */ | |||
LPCSTR lpszName; | /* address of module name | */ |
The ModuleFindName function fills the specified structure with information that describes the module with the specified name.
lpme
Points to a MODULEENTRY structure that will receive information about the module. The MODULEENTRY structure has the following form:
#include <toolhelp.h>
typedef struct tagMODULEENTRY { /* me */
DWORD dwSize;
char szModule[MAX_MODULE_NAME + 1];
HMODULE hModule;
WORD wcUsage;
char szExePath[MAX_PATH + 1];
WORD wNext;
} MODULEENTRY;
For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.
lpszName
Specifies the name of the module to be described.
The return value is the handle named in the lpszName parameter, if the function is successful. Otherwise, it is NULL.
The ModuleFindName function returns information about a currently loaded module by looking up the module's name in the module list.
This function can be used to begin a walk through the list of all currently loaded modules. An application can examine subsequent items in the module list by using the ModuleNext function.
Before calling ModuleFindName, an application must initialize the MODULEENTRY structure and specify its size, in bytes, in the dwSize member.