Skip to content

Latest commit

 

History

History
100 lines (72 loc) · 2.69 KB

getconsolemode.md

File metadata and controls

100 lines (72 loc) · 2.69 KB
title description author ms.author ms.topic keywords f1_keywords MS-HAID MSHAttr ms.assetid topic_type api_name api_location api_type
GetConsoleMode function
Retrieves the current input mode of a console's input buffer or the current output mode of a console screen buffer.
miniksa
miniksa
article
console, character mode applications, command line applications, terminal applications, console api
consoleapi/GetConsoleMode
wincon/GetConsoleMode
GetConsoleMode
\_win32\_getconsolemode
base.getconsolemode
consoles.getconsolemode
PreferredSiteName:MSDN
PreferredLib:/library/windows/desktop
49adf618-196d-4490-93ca-cd177807f58e
apiref
GetConsoleMode
Kernel32.dll
API-MS-Win-Core-Console-l1-1-0.dll
KernelBase.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
DllExport

GetConsoleMode function

Retrieves the current input mode of a console's input buffer or the current output mode of a console screen buffer.

Syntax

BOOL WINAPI GetConsoleMode(
  _In_  HANDLE  hConsoleHandle,
  _Out_ LPDWORD lpMode
);

Parameters

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

lpMode [out]
A pointer to a variable that receives the current mode of the specified buffer.

[!INCLUDE console-mode-flags]

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

[!INCLUDE console-mode-remarks]

To change a console's I/O modes, call SetConsoleMode function.

Examples

For an example, see Reading Input Buffer Events.

Requirements

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

See also

Console Functions

Console Modes

ReadConsole

ReadConsoleInput

ReadFile

SetConsoleMode

WriteConsole

WriteFile