ModuleFindHandle

3.1

  #include <toolhelp.h>    

  HMODULE ModuleFindHandle(lpme, hmod)    
  MODULEENTRY FAR* lpme; /* address of MODULEENTRY structure */
  HMODULE hmod; /* handle of module, */  

The ModuleFindHandle function fills the specified structure with information that describes the given module.

Parameters

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.

hmod

Identifies the module to be described.

Return Value

The return value is the handle of the given module if the function is successful. Otherwise, it is NULL.

Comments

The ModuleFindHandle function returns information about a currently loaded module whose module handle is known.

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 ModuleFindHandle, an application must initialize the MODULEENTRY structure and specify its size, in bytes, in the dwSize member.

See Also

ModuleFindName, ModuleFirst, ModuleNext