E
E
evgenyt20002020-04-29 17:29:21
C++ / C#
evgenyt2000, 2020-04-29 17:29:21

What function can be used to convert int PID to Handle?

Good evening.
The question is when creating a process, one of the processes receives a PID in the form of an int, and WaitForSingleObject needs a handle.
It seems like there is a function with which you can get it. That is, knowing the PID, find out the handle /
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Ananiev, 2020-04-29
@evgenyt2000

HANDLE processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
CloseHandle(processHandle);

M
Mercury13, 2020-04-29
@Mercury13

CreateProcess, last parameter: processInfo.hProcess.
https://stackoverflow.com/questions/42531/how-do-i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question