working implementation of window capture for win32