import time import os, win32gui, win32ui, win32con, win32api def window_capture(dpath,name,srcbmp=[0, 0, None, None]): hwnd = 0 hwndDC = win32gui.GetWindowDC(hwnd) mfcDC=win32ui.CreateDCFromHandle(hwndDC) saveDC=mfcDC.CreateCompatibleDC() saveBitMap…