Here is how I'm getting the "process created event" from:
System.Management.ManagementBaseObject WaitForNextEvent()
ManagementBaseObject e = watcher.WaitForNextEvent();
I require the:
- Window Title
- Caption (editor's note: I think Window Title and Caption are the same)
- Session Id
- Process Id
- Process Id (Parent)
What I have right now:
ManagementBaseObject e = watcher.WaitForNextEvent();
detail = new string[]
{
((e["TargetInstance"])["Caption"]).ToString(),
((e["TargetInstance"])["ProcessID"]).ToString(),
((e["TargetInstance"])["SessionId"]).ToString()
};
I got 3 of 5, but how can I get:
- Window Title
- Process Id (Parent)
Hint: You might be able to use the Process Id to find the missing fields.