Windows Character Mode Application 1






Windows-based applications consist of executable files and DLLs. Most applications interact with the user through a graphical user interface (GUI) or a character-mode interface. A running application is known as a process. Each process owns system resources. The threads of a process execute its code. The following topics describe the creation and usage of DLLs, processes, and threads. However, for this session we will only discuss Character-Mode Applications.






Character-Mode Applications

Character-mode applications do not provide their own graphical user interface. Instead, they interact with consoles.

Dynamic-Link Libraries

DLLs are executable modules that contain functions and data. DLLs provide a way to modularize applications so they can be loaded, updated, and reused more easily.

Process Status Helper

The process status helper functions make it easier for you to obtain information about processes and device drivers.

Processes and Threads

A thread is the basic unit to which the operating system allocates processor time. A process is an executing application that consists of one or more threads.


A service is an application that conforms to the interface rules of the Service Control Manager. Services can execute even when no user is logged on.


Threads can use synchronization functions to coordinate access to a resource.

Tool Help Library

The functions provided by the tool help library make it easier for you to obtain information about currently executing applications.

Window Stations and Desktops

A desktop is a securable object contained within a window station. A desktop has a logical display surface and contains user interface objects such as windows, menus, and hooks. Each desktop is associated with a thread and can be used to create and manage windows.


Character-Mode Applications


In this chapter we will concentrate on the character-mode applications. Consoles manage input and output (I/O) for character-mode applications which are applications that do not provide their own graphical user interface. The console functions enable different levels of access to a console. The high-level console I/O functions enable an application to read from standard input to retrieve keyboard input stored in a console's input buffer. The functions also enable an application to write to standard output or standard error to display text in the console's screen buffer. The high-level functions also support redirection of standard handles and control of console modes for different I/O functionality. The low-level console I/O functions enable applications to receive detailed input about keyboard and mouse events, as well as events involving user interactions with the console window. The low-level functions also enable greater control of output to the screen.


Intro to Character-Mode Applications


Consoles provide high-level support for simple character-mode applications that interact with the user by using functions that read from standard input and write to standard output or standard error. Consoles also provide sophisticated low-level support that gives direct access to a console's screen buffer and that enables applications to receive extended input information (such as mouse input).




A console is an interface that provides I/O to character-mode applications. This processor-independent mechanism makes it easy to port existing character-mode applications or to create new character-mode tools and applications. A console consists of an input buffer and one or more screen buffers. The input buffer contains a queue of input records, each of which contains information about an input event. The input queue always includes key-press and key-release events. It can also include mouse events (pointer movements and button presses and releases) and events during which user actions affect the size of the active screen buffer. A screen buffer is a two-dimensional array of character and color data for output in a console window. Any number of processes can share a console. We won’t dive the details for this topic. For more info please find it in MSDN - Character Mode Applications.




< Character Mode App. Win32 Programming | Win32 Programming | Character Mode App. Win32 Programming 2 >