def _iter_pos(self):
        rect = ctypes.create_string_buffer(16)  # To be written to by GetWindowRect. RECT structure.
        while ctypes.windll.user32.GetWindowRect(self.hwnd, rect):
            left, top, right, bottom = struct.unpack('llll', rect.raw)
            width, height = right - left, bottom - top
            assert width > 1
            assert height > 1
            yield left, top, right, bottom
        raise StopIteration
Yield new console window's current position and dimensions.
dataset/ETHPy150Open Robpol86/colorclass/tests/screenshot.py/RunNewConsole._iter_pos