Skip to content

Latest commit

 

History

History
85 lines (64 loc) · 3.36 KB

getconsolescreenbufferinfoex.md

File metadata and controls

85 lines (64 loc) · 3.36 KB
title description author ms.author ms.topic keywords f1_keywords MS-HAID MSHAttr ms.assetid topic_type api_name api_location api_type
GetConsoleScreenBufferInfoEx function
Retrieves extended information about the specified console screen buffer.
miniksa
miniksa
article
console, character mode applications, command line applications, terminal applications, console api
consoleapi2/GetConsoleScreenBufferInfoEx
wincon/GetConsoleScreenBufferInfoEx
GetConsoleScreenBufferInfoEx
base.getconsolescreenbufferinfoex
consoles.getconsolescreenbufferinfoex
PreferredSiteName:MSDN
PreferredLib:/library/windows/desktop
60534226-d26f-44e2-a4cc-64811882e308
apiref
GetConsoleScreenBufferInfoEx
Kernel32.dll
API-MS-Win-Core-Console-l2-1-0.dll
KernelBase.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
DllExport

GetConsoleScreenBufferInfoEx function

Retrieves extended information about the specified console screen buffer.

Syntax

BOOL WINAPI GetConsoleScreenBufferInfoEx(
  _In_  HANDLE                        hConsoleOutput,
  _Out_ PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx
);

Parameters

hConsoleOutput [in]
A handle to the console screen buffer. The handle must have the GENERIC_READ access right. For more information, see Console Buffer Security and Access Rights.

lpConsoleScreenBufferInfoEx [out]
A CONSOLE_SCREEN_BUFFER_INFOEX structure that receives the requested console screen buffer information.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The rectangle returned in the srWindow member of the CONSOLE_SCREEN_BUFFER_INFOEX structure can be modified and then passed to the SetConsoleWindowInfo function to scroll the console screen buffer in the window, to change the size of the window, or both.

All coordinates returned in the CONSOLE_SCREEN_BUFFER_INFOEX structure are in character-cell coordinates, where the origin (0, 0) is at the upper-left corner of the console screen buffer.

Tip

This API does not have a virtual terminal equivalent. Its use may still be required for applications that are attempting to draw columns, grids, or fill the display to retrieve the window size. This window state is managed by the TTY/PTY/Pseudoconsole outside of the normal stream flow and is generally considered a user privilege not adjustable by the client application. Updates can be received on ReadConsoleInput.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Header ConsoleApi2.h (via WinCon.h, include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

Console Functions

CONSOLE_SCREEN_BUFFER_INFOEX

SetConsoleScreenBufferInfoEx