First, many thanks to nobugus for this post, I had been hunting around for a way to do this for a while now, and this post was a huge boon!

It's worth noting though, that the code as is in the first post has a memory leak, and that if you wrap his code in a function take enough screenshots it will eventually crash with a windows error code 8. (On my system, this happens somewhere between 100 and 200 screenshots).

Adding...