So you want to have an application that
a) scans all the running processes
b) for an identified subset of those, determine how long each has been
"idle"
c) stop those whose idle time exceeds a threshold and
d) inform the user you have done so with a friendly message.
A pretty puzzle, and I hope some guru or other can help you.
I found some interesting stuff in System.Diagnostics.Process. If I am
reading that correctly, you can find the processes and their names (a).
You can find their state (e.g. idle in ProcessPriorityClass), but I don't
see an idle time in that class.
If you had a thread that checked the state every few seconds... but the
problem I see is that it may have gone un-idle and back to idle in the
interim. I suppose you could check resource usage -- TotalProcessorTime --
and if it is unchanged for the time period...
In any case,
Good Luck!