A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z


The GetModuleFileNameEx function retrieves the fully qualified path for the specified module.

Declare Function GetModuleFileNameEx Lib "PSAPI.DLL" (ByVal hProcess As Long, ByVal hModule As Long, ByVal ModuleName As String, ByVal nSize As Long) As Long


Operating Systems Supported
Requires Windows NT 4.0 or later; Win9x/ME: Not supported


Parameter Information
- hProcess
[in] Handle to the process that contains the module.

- hModule
[in] Handle to the module.

- lpFilename
[out] Pointer to the buffer that receives the fully qualified path to the module. If the file name is longer than maximum number of characters specified by the nSize parameter, the file name is truncated.

- nSize
[in] Specifies the maximum number of characters to copy to the lpFilename buffer.

Return Values
If the function succeeds, the return value specifies the length of the string copied to the buffer.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Last update: 07 April 2006