SetConsoleScreenBufferInfoEx function

Expand
This topic has not yet been rated - Rate this topic

SetConsoleScreenBufferInfoEx function

Applies to: desktop apps only

Sets extended information about the specified console screen buffer.

Syntax

BOOL WINAPI SetConsoleScreenBufferInfoEx(
  __in  HANDLE hConsoleOutput,
  __in  PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx
);

Parameters

hConsoleOutput [in]

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

lpConsoleScreenBufferInfoEx [in]

A CONSOLE_SCREEN_BUFFER_INFOEX structure that contains the 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.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Wincon.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Console Functions
CONSOLE_SCREEN_BUFFER_INFOEX
GetConsoleScreenBufferInfoEx

 

 

Send comments about this topic to Microsoft

Build date: 5/5/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD
Off by One Bug
The srWindow.Right and srWindow.Bottom fields appear to be exclusive in SetConsoleScreenBufferInfoEx but inclusive in GetConsoleScreenBufferInfoEx, at least on Vista SP1.

Getting the CONSOLE_SCREEN_BUFFER_INFOEX struct and immediately setting it with the same values will shrink your window one character cell in each direction.
2/16/2009