How can a Win32 process get the pid of its parent?
Just in case anyone else runs across this question and is looking for a code sample, I had to do this recently for a Python library project I’m working on. Here’s the test/sample code I came up with: #include <stdio.h> #include <windows.h> #include <tlhelp32.h> int main(int argc, char *argv[]) { int pid = -1; HANDLE … Read more