Get PID Process Handler

I want to get a process descriptor by process name.

I have a PID, but when I use openProcessto get the descriptor always, it will return 0 or 180, the function that I use to work PID correctly

Handle := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ,False,PID);

What should I do?

0
source share
1 answer

There is no direct way to get a handle to a process when all you know is its name if you are not using it CreateProcess.

CreateToolhelp32Snapshot, Process32First Process32Next , . , . . OpenProcess, . OpenProcess - (, 180), .

+7

Source: https://habr.com/ru/post/1788811/


All Articles