I've seen this property and that's what i'm trying to get. In fact when i
launch my testing app, it will show "Process Created !" in a label when i
lauhc notepad for example. But i don't where i can get an handle on the
instance of the Win32_Process class created.
This is the way i did:
Using the WMI extension for VS .NET server explorer, I created a managed
class from Win32_Process and i subscribed to an event wiwh WQL query is :
SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA
"Win32_Process"
this is the method used:
private void CreationEven{*filter*}cher_EventArrived(object sender,
System.Management.EventArrivedEventArgs e)
{
LblRes.Text= "Process Created !";
Quote:
}
maybe i could do something with "System.Management.EventArrivedEventArgs e"
but i don't know what.
I just need the handle of the instance (as you wrote it there is the field
"ProcessID") created or the pid of the process...
Stphan.
Quote:
> Stephan,
> The Win32_Process class has a ProcessId field that you can query for
the
> Process Id.
> Hope this helps.
> --
> - Nicholas Paldino [.NET MVP]
> > Hello,
> > i have to code an application wich is supposed to monitor processes
> > (creation date, CPU time, etc..) and CPUs ( user time by process, etc.)
> > for multi-CPUs servers.
> > I use WMI events to know when a process is created or deleted but i
don't
> > know how to get the id of this process, i can't continue without this
id.
> > could someone help me ?
> > thanks.
> > Stphan.