I know that using Windows API one can get a short file name of the module that corresponds to that process ID: Example below. Error handling omitted. Question: is there a Windows API just like GetModuleBaseName
that returns full path to the module?
// open process
hProc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwPid);
// get the module handle
EnumProcessModules(hProc, &hMod, sizeof(hMod), &dwSize2))
// get the module name
DWORD rez =::GetModuleBaseName(hProc, hMod, szFileName, sizeof(szFileName));