How can I retrieve a process\'s fully-qualified path from its PID using C++ on Windows?
Sometimes GetModuleFileNameEx returns the 299 error code (I don't know why)
GetModuleFileNameEx
The only method that works for all versions of Windows, including XP is in Nathan Moinvaziri answer:
check the provided url:
Windows API to Get a Full Process Path