Having a KNOB to the process, how to register to monitor your close / restart / duplication event?

Having a process descriptor, for example:

HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
    PROCESS_VM_READ,
    FALSE, processID );

How to register for this process of updating events - for example, close \ restart? Is it possible to register for a duplication event (starting a second of the same process)?

+3
source share
1 answer

Handlers are processed when the process they represent terminates. Therefore, to find out when the process ends, you can pass hProcessin WaitForSingleObjector any other wait function.

+1
source

All Articles