You can do it with Python.
Here is an example that takes the entire desktop, but with the window object and a little more Python should be able to take screehshot of only the game window:
See some of Rojohound's examples for Ctypes and the window object for how to mesh the two together. CHeers!!