According to the documentation of the Console
class, it provides access only to the standard output stream, not to the screen buffer (although you can change some properties of the buffer, such as its size). And MoveBufferArea
is another obvious exception, but doesn't really apply here1.
The Win32 API does provide access to the console buffer. You would probably want to p/invoke WriteConsoleOutput
or WriteConsoleOutputCharacter
. (p/invoke declarations here)
Notably:
WriteConsoleOutput
has no effect on the cursor position.
Oh, you'll probably want the Unicode versions (ending in W
) because .NET strings are all UTF-16.
1 It lets you provide content two ways: content already in the buffer -- but getting it there in the first place is the problem, or from a character and attribute provided -- but this is only used to fill the "source" area, and the destination is not optional.