user366312
user366312

Reputation: 17006

Win32 API Console Programming in C

I am stuck with the problems like, reading text from a specific location (x=10, y=5) on the console window.

Where can I find a detail tutorial on Win32 API Console mode programming in C?

Upvotes: 2

Views: 3830

Answers (2)

Hans Passant
Hans Passant

Reputation: 942247

You'd need to use ReadConsoleOutput(). Beware of the ambiguity in a coordinate like (10, 5). It could be relative from the console window upper-left corner. Or from the screen buffer. You'd probably need to make the buffer size the same as the window size to avoid this. SetConsoleScreenBufferSize().

These console functions are not wrapped by the C-runtime. The SDK documentation is quite decent, start here.

Upvotes: 3

Tim Robinson
Tim Robinson

Reputation: 54764

On MSDN, see the section on Character Mode Applications.

You can read text from the screen using the ReadConsoleOutputCharacter function.

Upvotes: 3

Related Questions