Skip to content

Latest commit

 

History

History
102 lines (73 loc) · 2.68 KB

setconsolemode.md

File metadata and controls

102 lines (73 loc) · 2.68 KB
title description author ms.author ms.topic keywords f1_keywords MS-HAID MSHAttr ms.assetid topic_type api_name api_location api_type
SetConsoleMode function
Sets the input mode of a console's input buffer or the output mode of a console screen buffer.
miniksa
miniksa
article
console, character mode applications, command line applications, terminal applications, console api
consoleapi/SetConsoleMode
wincon/SetConsoleMode
SetConsoleMode
\_win32\_setconsolemode
base.setconsolemode
consoles.setconsolemode
PreferredSiteName:MSDN
PreferredLib:/library/windows/desktop
77508d58-8a7a-4c47-9ec5-dc61e5c4beac
apiref
SetConsoleMode
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

SetConsoleMode function

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

Syntax

BOOL WINAPI SetConsoleMode(
  _In_ HANDLE hConsoleHandle,
  _In_ DWORD  dwMode
);

Parameters

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

dwMode [in]
The input or output mode to be set.

[!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 determine the current mode of a console input buffer or a screen buffer, use the GetConsoleMode 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

GetConsoleMode

HandlerRoutine

ReadConsole

ReadConsoleInput

ReadFile

WriteConsole

WriteFile