GetModuleFileNameEx The GetModuleFileNameEx function retrieves the fully qualified path for the specified module.
VB4-32,5,6
Declare Function GetModuleFileNameEx Lib "PSAPI.DLL" (ByVal hProcess As Long, ByVal hModule As Long, ByVal ModuleName As String, ByVal nSize As Long) As Long |
VB.NET
System.Diagnostics.ProcessModule.FileName |
Operating Systems Supported |
Requires Windows NT 4.0 or later; Win9x/ME: Not supported |
- 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. |
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. |
|