GetModuleBaseName

The GetModuleBaseName function retrieves the base name of the specified module.

DWORD GetModuleBaseName(
  HANDLE hProcess,    // handle to the process
  HMODULE hModule,    // handle to the module
  LPTSTR lpBaseName,  // buffer that receives the base name
  DWORD nSize         // size of the buffer
);
 

Parameters

hProcess
Handle to the process that contains the module.
hModule
Handle to the module.
lpBaseName
Pointer to the buffer that receives the base name of the module.
nSize
Specifies the size, in bytes, of the lpBaseName buffer.

Return Value

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.

See Also

Process Status Helper Overview, PSAPI Functions, EnumProcesses, GetModuleFileNameEx