myWallJSON
myWallJSON

Reputation: 9522

having a HANDLE to a Process how to sign up for monitoring of its close/restart/duplication event?

Having a handle tpo a process like so:

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

How to sign up for this process update events - like close\restart? Is it possible to sign up for duplication event (start up of second same process)?

Upvotes: 3

Views: 100

Answers (1)

Adam Roben
Adam Roben

Reputation: 784

Process handles are signaled when the process they represent exits. So to find out when the process exits, you can pass hProcess to WaitForSingleObject or any other wait function.

Upvotes: 1

Related Questions