if you want i can port the above solution to fossil and test it.  fossil would have to link with psapi.lib.  i'm not sure if it already does this or not.