Take a screenshot of a window