std::string path_by_pid(DWORD processId)
{
HANDLE handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, processId);
if (handle)
{
DWORD buffSize = 1024; char buffer[1024];
if (QueryFullProcessImageNameA(handle, 0, buffer, &buffSize))
return buffer;
CloseHandle(handle);
}
return "";
}