The GetModuleFileNameEx function retrieves the fully qualified path for the specified module.
DWORD GetModuleFileNameEx(
HANDLE hProcess, // handle to the process
HMODULE hModule, // handle to the module
LPTSTR lpFilename, // buffer that receives the path
DWORD nSize // size of the 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.
Process Status Helper Overview, PSAPI Functions, EnumProcesses, GetModuleBaseName