Win32 console

Win32 console

Win32 console is a plain text window for console applications within the system of Windows API. A Win32 console has a screen buffer and an input buffer.

Win32 consoles are typically used for applications that do not need to display images. Examples include command line interface tools such as command line interpreters (e.g., CMD.EXE, Windows PowerShell, Korn shell) or text user interface applications such as file managers and text editors (e.g. Midnight Commander, MS-DOS Editor).

Details

The input buffer is a queue where events are stored (from keyboard, mouse etc). The output buffer is a rectangular grid where characters are stored, together with their attributes. A console window may have several output buffers, only one of which is active (i.e. displayed) for a given moment.

The console window may be displayed as a normal window on the desktop, or may be switched to full screen to use the actual hardware text mode. Unfortunately, the display mode is locked in background intensity mode, thus blinking does not work. Also, the underscore attribute is not available.

Programs may access a Win32 console either via high-level functions (such as ReadConsole and WriteConsole) or via low-level functions (e.g. ReadConsoleInput and WriteConsoleOutput). These high-level functions are more limited than a Win32 GUI; for instance it is not possible for a program to change the color palette, nor is it possible to modify the font used by the console using these functions.

Win32 console applications are often mistaken for MS-DOS applications, especially on Windows 9x and Windows Me. However, a Win32 Console application is just a special form of a native Win32 application - it is not a 16-bit DOS application. 32-bit Windows can run MS-DOS programs through the use of the NT Virtual DOS Machine (NTVDM).

In earlier versions of Windows, there was no native support for consoles. Since Windows 3.1 and earlier was merely a graphical interface for MS-DOS, most text applications that ran on earlier Windows versions were actually MS-DOS applications running in "DOS boxes". To simplify the task of porting applications to Windows, early versions of Visual C++ were supplied with QuickWin, a library that implemented basic console functionality inside a regular Window.

Implementations

Windows 9x and Me

Windows 95/98/Me support is relatively poor compared to Windows NT, because the console window runs in the system VM and so keyboard input to a Win32 console application had to be directed to it by conagent.exe running in a DOS VM that are also used for real DOS applications by hooking the keyboard interrupt. conagent.exe then calls Vcond (which is a VxD). Vcond then had to pass the keyboard input to the System VM, and then finally to the Win32 console application.Besides performance, another problem with this implementation is that drives that are local to a DOS VM are not visible to a Win32 console application. This can cause confusion.

Under Windows 95/98/Me, the screen buffer mirrors the structure of VGA text buffer, with two bytes per character cell: one byte for character code, one byte for attributes (the character must be in OEM character set, the attribute is with high-intensity background/no blinking). This speeds up operation considerably if the actual VGA text mode is used.

Windows NT and CE based

The Client/Server Runtime Subsystem is responsible for Win32 console windows on Windows NT based operating systems. [ [http://www.microsoft.com/technet/security/advisory/928604.mspx Microsoft Security Advisory (930181): Exploit Code Published Affecting Windows Client Server Run-Time Subsystem ] ]

Under Windows NT and CE based versions of Windows, the screen buffer uses four bytes per character cell: two bytes for character code, two bytes for attributes. The character is then encoded as Unicode (UTF-16). [UTF-16 uses surrogate pairs to extend 16-bit codes to the full Unicode range.] [cite web |url=http://msdn2.microsoft.com/en-us/library/ms904390.aspx |title=Working with Surrogate Pairs |publisher=Microsoft |date=2007 |accessdate=2007-11-19] For backward compatibility, the console APIs exist in two versions: Unicode and non-Unicode. The non-Unicode versions of APIs can use code page switching to extend the range of displayed characters (but only if TrueType fonts are used for the console window, thereby extending the range of codes available). Even UTF-8 is available as "code page 65001".

ee also

* Cmd.exe
* Command line interface
* MS-DOS
* Shell (computing)
* System console
* Text-based (computing)

Notes

External links

* [http://msdn2.microsoft.com/en-us/library/ms682087.aspx MSDN console API reference]


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Console — Contents 1 Computing and video games 2 Music 3 Other 4 Se …   Wikipedia

  • Console application — This article refers to applications with text input consoles. See console game for more information about applications that can run on video game consoles. FreeDOS edit, a text editor …   Wikipedia

  • Win32 — Windows API (application programming interfaces) общее наименование целого набора базовых функций интерфейсов программирования приложений операционных систем семейств Windows и Windows NT корпорации «Майкрософт». Является самым прямым способом… …   Википедия

  • Win32 API — Windows API (application programming interfaces) общее наименование целого набора базовых функций интерфейсов программирования приложений операционных систем семейств Windows и Windows NT корпорации «Майкрософт». Является самым прямым способом… …   Википедия

  • Linux console — The Linux console is a system console support in the Linux kernel. The Linux console was the first functionality of the kernel, developed as early as in 1991 (see history of Linux). On PC architecture, it is common to use VGA compatible video… …   Wikipedia

  • System console — Knoppix system console showing the boot process The system console, root console or simply console is the text entry and display device for system administration messages, particularly those from the BIOS or boot loader, the kernel, from the init …   Wikipedia

  • Microsoft Management Console — A component of Microsoft Windows …   Wikipedia

  • Microsoft Management Console — Для термина «Консоль» см. другие значения. Microsoft Management Console (консоль управления)  компонент операционной системы Windows 2000 и более поздних версий Windows. Позволяет системным администраторам и продвинутым пользователям с… …   Википедия

  • List of video game console emulators — This is a selected list of video game system emulators. For information about emulating specific systems, including those not covered by the emulators in this list, see the respective article for each system. Contents 1 Arcade 2 Atari 2.1 Atari… …   Wikipedia

  • Microsoft Windows library files — Like most modern operating systems, Microsoft Windows supports shared libraries, collections of code which can be used by multiple processes while only being loaded once into memory. Windows terms its shared libraries Dynamic link libraries… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”