Method process.triggers
Overload
Provides process started/ended triggers in foreach
loop. See examples.
public static IEnumerable<ProcessTriggerInfo> triggers(bool? started = null, string processName = null, bool ofThisSession = false, int period = 100)
Parameters
started (bool?)
Trigger events: |
processName (string)
Process executable file name, like |
ofThisSession (bool)
Watch processes only of this user session. |
period (int)
The period in milliseconds of retrieving the list of processes for detecting new and ended processes. Default 100, min 10, max 1000. Smaller = smaller average delay and less missing triggers (when process lifetime is very short) but more CPU usage. |
Returns
IEnumerable<ProcessTriggerInfo>
An object that retrieves process trigger info (started/ended, name, id, session id) when used with |
Exceptions
ArgumentException
Invalid wildcard expression ( |
Examples
//all started and ended processes
foreach (var v in process.triggers()) {
print.it(v);
}
//started notepad processes in current user session
foreach (var v in process.triggers(started: <c>true</c>, "notepad.exe", ofThisSession: true)) {
print.it(v);
}