Is there a way to determine which window is active?  I'm thinking I could not only detect a switch from active to idle, but maybe I could determine which window is the active one and log how many times its the active window each time the timer goes off.  when the active window changes, I could write it to a log and time the next active window, etc

 

If I had that sort of log, I could then suck it into excel and maybe figure out what it was I was doing when I look back over a week's worth of data (I have no clue how much time I might be wasting in a week).