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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.