Trigger the process events using Process Id

Mar 19 2008 1:28 AM
Hi..

I am able to get the process (as object) running in the sysetm through process id. I need to trigger the event that corresponds to the process (object) i got. Note that the Process object i get is not started by me or started in separate application.

In my application, i need to get the object and the trigger of the process events - like process.Exited.


code snippet,

AddHandler gService.toolProc.Exited, AddressOf IsProcessCompleted

        gService.toolProc = Process.GetProcessById(processID)
        gService.toolProc.EnableRaisingEvents = True


Thanks in advance,

Regards,
Ashokan