Skip to content

Commit

Permalink
Cross-link information on buffers from each of these conceptual artic…
Browse files Browse the repository at this point in the history
…les. #138
  • Loading branch information
miniksa committed Aug 17, 2021
1 parent ff613a7 commit f3986ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/creation-of-a-console.md
Expand Up @@ -29,7 +29,7 @@ Typically, a process uses [**AllocConsole**](allocconsole.md) to create a consol

A process can also create a console by specifying the **CREATE\_NEW\_CONSOLE** flag in a call to [**CreateProcess**](/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa). This method creates a new console that is accessible to the child process but not to the parent process. Separate consoles enable both parent and child processes to interact with the user without conflict. If this flag is not specified when a console process is created, both processes are attached to the same console, and there is no guarantee that the correct process will receive the input intended for it. Applications can prevent confusion by creating child processes that do not inherit handles of the input buffer, or by enabling only one child process at a time to inherit an input buffer handle while preventing the parent process from reading console input until the child has finished.

Creating a new console results in a new console window, as well as separate I/O screen buffers. The process associated with the new console uses the [**GetStdHandle**](getstdhandle.md) function to get the handles of the new console's input and screen buffers. These handles enable the process to access the console.
Creating a new console results in a new console window, as well as separate I/O buffers for [output to the screen](console-screen-buffers.md) and [input from the user](console-input-buffer.md). The process associated with the new console uses the [**GetStdHandle**](getstdhandle.md) function to get the handles of the new console's input and screen buffers. These handles enable the process to access the console.

When a process uses [**CreateProcess**](/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa), it can specify a [**STARTUPINFO**](/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa) structure, whose members control the characteristics of the first new console (if any) created for the child process. The **STARTUPINFO** structure specified in the call to **CreateProcess** affects a console created if the **CREATE\_NEW\_CONSOLE** flag is specified. It also affects a console created if the child process subsequently uses [**AllocConsole**](allocconsole.md). The following console characteristics can be specified:

Expand Down
2 changes: 1 addition & 1 deletion docs/input-and-output-methods.md
Expand Up @@ -17,7 +17,7 @@ ms.assetid: 55a86d5d-d0b1-4d0c-b42f-7342809289ad

# Input and Output Methods

There are two different approaches to console I/O, the choice of which depends on how much flexibility and control an application needs. The high-level approach enables simple character stream I/O, but it limits access to a console's input and screen buffers. The low-level approach requires that developers write more code and choose among a greater range of functions, but it also gives an application more flexibility.
There are two different approaches to console I/O, the choice of which depends on how much flexibility and control an application needs. The high-level approach enables simple character stream I/O, but it limits access to a console's [input](console-input-buffer.md) and [screen](console-screen-buffers.md) buffers. The low-level approach requires that developers write more code and choose among a greater range of functions, but it also gives an application more flexibility.

> [!NOTE]
> The low-level approach is not recommended for new and ongoing development. Applications needing functionality from the low-level console I/O functions are encouraged to use **[virtual terminal sequences](console-virtual-terminal-sequences.md)** and explore our documentation on both **[classic functions versus virtual terminal](classic-vs-vt.md)** and **[the ecosystem roadmap](ecosystem-roadmap.md)**.
Expand Down

0 comments on commit f3986ae

Please sign in to comment.