Search code examples
c#javaprocessmonitoringtask-tracking

Track used applications


I've been using Wakoopa recently, and I find it quite amusing.

I had no idea ( well I had an idea but never got real data about it ) on how much time I spend in SO until this:

alt text http://img396.imageshack.us/img396/4699/wakoopaim1.png

So my programming question is:

How can I programmatically track the applications being used?

My initial though was to use something like "tasklist" command and "netstat" and pool every 15 minutes or something like that, but I don't think this is the way they're doing this.

Is there a library in .NET ( in C# I guess ) to do this? Does windows provides some kind of service like this? What about java?

I usually have at least some vague idea on how some programming task could be performed, but for this I don't have a clue.

The wakoopa app tracker works on OSX and Linux too, but it is clear to me they are three different apps, one per platform

BTW, how much do you used SO? :)


Solution

  • Here is a link to an article with source covering the Process Structure Routines API Detecting Windows NT/2K process execution. I thought that the SysInternals site had source to Process Monitor, but I don't see any. The article should point you in the right direction for Windows systems.

    Here is a link that may be helpful for Linux systems PROCPS

    Here is a link to a java swing top utility Monitor It uses JNI, so not sure if it really fits as a java solution.

    And to answer the SO question, I only periodically visit the site. I find I spend too much time on it if I visit regularly.