Saturday, 19 August, 2006

Extending the .NET Console Interface

Although graphical user interfaces are all the rage these days (and rightly so!), there's still some call for character-mode (console) applications.  In .NET versions 1.0 and 1.1, support for console applications was limited:  sequential access to the standard I/O streams.  .NET 2.0 introduced a much more complete console interface that allows cursor positioning, setting text attributes, and a few other low-level console tricks, but it doesn't even come close to supporting the full power of the Windows Console API.

My article, Extending the .NET Console Interface, is the first of three planned articles that explore the Windows Console interface and present a .NET class that exposes the entire API to .NET programs.  This first article covers creating and attaching to consoles, responding to console control events, and using console aliases.  The second article will discuss the console screen buffer in detail, and the third will be all about using the console input buffer.  Full source code for the article is available for download here.