Search code examples
c++windowspid

How to fetch Parent Process Id on Windows


Is there an API in the C++ (or STL) to fetch the parent process id? if not then what could be the portable code to do so? I understand there linux api such as getppid can do the job on unix platforms but what is equivalent of the same on windows?

Thanks!


Solution

  • Following links will hep you

    http://www.codeproject.com/Articles/9893/Get-Parent-Process-PID

    https://gist.github.com/253013/d47b90159cf8ffa4d92448614b748aa1d235ebe4