An application cannot know what tasks you are working on. It is, however, possible to figure out automatically what kind of activity you are currently performing. For example, if the top level application is an email client, the window title starts with "Compose" and you are typing a lot, this must be "Email Writing". In Herring Activity Tracker you can define such rules for your specific activity categories and then analyse where your time goes during a day.
The rules are defined in a simple textual file, Rules.txt (located in the user-specific application data folder, %USERPROFILE% \AppData\Roaming). Each line defines one rule. The syntax is:
[process:<text>][title:<text>][keyboard-min:<value>][keyboard-max:<value>][mouse-min:<value>][mouse-max:<value>] => <category-name>
The order of the elements is not important. The <text> elements can be enclosed with parenthesis to be unambiguous.
process:postbox.exe title:"Compose:" keyboard-min:5 => Email Writing
process:Herring.exe => Introspection
process:WINWORD.EXE keyboard-max:5 => Document Reading