class_docstr: I/O abstraction for rendering to Windows consoles.
  (cmd.exe and similar.)
class_docstr_tok: ["I\/O","abstraction","for","rendering","to","Windows","consoles",".","(","cmd.exe","and","similar",".",")"]
code: def get_size(self) -> Size:
      info = self.get_win32_screen_buffer_info()
  
      # We take the width of the *visible* region as the size. Not the width
      # of the complete screen buffer. (Unless use_complete_width has been
      # set.)
      if self.use_complete_width:
          width = info.dwSize.X
      else:
          width = info.srWindow.Right - info.srWindow.Left
  
      height = info.srWindow.Bottom - info.srWindow.Top + 1
  
      # We avoid the right margin, windows will wrap otherwise.
      maxwidth = info.dwSize.X - 1
      width = min(maxwidth, width)
  
      # Create `Size` object.
      return Size(rows=height, columns=width)
  
imports: from __future__ import annotations
  import sys
  import os
  from ctypes import ArgumentError, byref, c_char, c_long, c_uint, c_ulong, pointer
  from ctypes.wintypes import DWORD, HANDLE
  from typing import Callable, TextIO, TypeVar
  from prompt_toolkit.cursor_shapes import CursorShape
  from prompt_toolkit.data_structures import Size
  from prompt_toolkit.styles import ANSI_COLOR_NAMES, Attrs
  from prompt_toolkit.utils import get_cwidth
  from prompt_toolkit.win32_types import CONSOLE_SCREEN_BUFFER_INFO, COORD, SMALL_RECT, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE
  from ..utils import SPHINX_AUTODOC_RUNNING
  from .base import Output
  from .color_depth import ColorDepth
label_desc: Use image node_id 6 for calling the Win32Output obj's underlying member method code with example usage: obj.get_size() and returns: Size