The basics of console programming include the following five articles:
- Console Basic Concepts
- Console Foundation Concept Examples
- console input and output mechanism
- console input and output mechanism example
- Console access rights, aliases, and considerations
Write this series of articles, mainly to organize the concept of the console and knowledge of my past on the console of understanding and learning to do a relatively complete summary.
The main console is the input buffer and screen buffer composition, the above five articles are mainly for the two buffer expansion.
"The basic concept of the console" is dominated by theory, introducing the fundamental elements of the console: input buffering, screen buffering, the composition of various elements, the input buffer contains a variety of keyboard, mouse, window scaling, buffer changes, menus and other events, screen buffering mainly includes character attributes, cursors, window position and so on. The "console input and output mechanism" article mainly describes the console API provides high-level, the underlying access mechanism, including the console's input and output mode, high-level input and output functions, the bottom input and output functions, and finally briefly introduced the console of the code page and event processing mode. The "console access, aliases, and Considerations" article, as a supplemental part of the console input and output, mainly describes the console screen buffering access, console alias mechanism.
One of the "console basic concept Instances", "console input and output mechanism examples" in the main to the respective conceptual explanation given in the sample code, there are some reference MSDN, modify part of the code, improve the contrast effect, part of the example is I write myself.
Through the finishing of these five articles, we can basically understand the operation principle of the console, and control the various parts of the console.
There is also some content that is not introduced here. such as the selection and replication of the console text area, console input buffer event query and empty, console simulation keyboard input, console code page switch and use. Go deeper into the effect of implementing a text editor on the console, simulating GUI drawings (text-based games), and more. Interested readers are advised to refer to the relevant information on MSDN below.
Again, this article is all about the discussion under Windows, *nix may have a similar mechanism, but because I do not have any understanding of the *nix system, there is no cross-platform instructions and attempts.
Basic summary of Console programming