Trouble capturing window with winAPI BitBlt for some applications only
问题 I've put together a simple python script that is supposed to take a screenshot of a window whose name contains a specific string. The code I use is the following, import win32gui, win32ui, win32con import PIL.Image def getWindowHandle(name): windowList = [] win32gui.EnumWindows(lambda hwnd, wndList: wndList.append((win32gui.GetWindowText(hwnd), hwnd)), windowList) for pair in windowList: if name in pair[0]: return pair[1] return None class Window(): def __init__(self, hwnd = None): if not