Process Handle given Process ID
-
This may be something simple, but I can't seem to find it anywhere. Does anyone know of a way to get a handle to a process if I know the process ID? What I am trying to do is see if the process is still active by calling GetExitCodeProcess. I am getting the PID by enumerating the processes that are running at a certain time. Technically I could just run through all the running processes everytime I wanted to know if the process was running and compare PIDs, but that seems like overkill. It would be much simpler just to get the handle once, and check at anytime in the future using GetExitCodeProcess. Thanks, Mike
-
This may be something simple, but I can't seem to find it anywhere. Does anyone know of a way to get a handle to a process if I know the process ID? What I am trying to do is see if the process is still active by calling GetExitCodeProcess. I am getting the PID by enumerating the processes that are running at a certain time. Technically I could just run through all the running processes everytime I wanted to know if the process was running and compare PIDs, but that seems like overkill. It would be much simpler just to get the handle once, and check at anytime in the future using GetExitCodeProcess. Thanks, Mike
Try HANDLE OpenProcess(DWORD dwDesiredAccess, // access flag BOOL bInheritHandle, // handle inheritance option DWORD dwProcessId // process identifier ); Crivo Automated Credit Assessment
-
Try HANDLE OpenProcess(DWORD dwDesiredAccess, // access flag BOOL bInheritHandle, // handle inheritance option DWORD dwProcessId // process identifier ); Crivo Automated Credit Assessment