Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 2.43 KB

setconsoleactivescreenbuffer.md

File metadata and controls

85 lines (63 loc) · 2.43 KB
title description author ms.author ms.topic keywords f1_keywords MS-HAID MSHAttr ms.assetid topic_type api_name api_location api_type
SetConsoleActiveScreenBuffer function
Sets the specified screen buffer to be the currently displayed console screen buffer.
miniksa
miniksa
article
console, character mode applications, command line applications, terminal applications, console api
consoleapi2/SetConsoleActiveScreenBuffer
wincon/SetConsoleActiveScreenBuffer
SetConsoleActiveScreenBuffer
\_win32\_setconsoleactivescreenbuffer
base.setconsoleactivescreenbuffer
consoles.setconsoleactivescreenbuffer
PreferredSiteName:MSDN
PreferredLib:/library/windows/desktop
c026cb94-c8ec-44ee-b432-3870ae3006c2
apiref
SetConsoleActiveScreenBuffer
Kernel32.dll
API-MS-Win-Core-Console-l2-1-0.dll
KernelBase.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
DllExport

SetConsoleActiveScreenBuffer function

[!INCLUDE not-recommended-banner]

Sets the specified screen buffer to be the currently displayed console screen buffer.

Syntax

BOOL WINAPI SetConsoleActiveScreenBuffer(
  _In_ HANDLE hConsoleOutput
);

Parameters

hConsoleOutput [in]
A handle to the console screen buffer.

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

A console can have multiple screen buffers. SetConsoleActiveScreenBuffer determines which one is displayed. You can write to an inactive screen buffer and then use SetConsoleActiveScreenBuffer to display the buffer's contents.

[!INCLUDE no-vt-equiv-alt-buf]

Examples

For an example, see Reading and Writing Blocks of Characters and Attributes.

Requirements

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

See also

Console Functions

Console Screen Buffers

CreateConsoleScreenBuffer