14.4. Raw Input

One of the nicest things about the examples in the previous section is that they are so simple. In Listing 14.1, for example, the program allocates a console, gets its handles, and begins writing to it. The console automatically handles backspacing, scrolling, and so on.

There are many situations, however, where you would like more control over the input and output streams. For example, you may want to retrieve characters one at a time as the user enters them. To do this, you need to get raw input from the console. Alternatively, you can create a GUI program and retrieve characters in the normal event-driven manner from the event queue. Using raw input from consoles is generally easier because it ensures that the console continues ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.