Skip to content

Latest commit

 

History

History
85 lines (64 loc) · 2.52 KB

File metadata and controls

85 lines (64 loc) · 2.52 KB
title FlushConsoleInputBuffer function
description Flushes the console input buffer. All input records currently in the input buffer are discarded.
author miniksa
ms.author miniksa
ms.topic article
keywords console, character mode applications, command line applications, terminal applications, console api
f1_keywords
consoleapi2/FlushConsoleInputBuffer
wincon/FlushConsoleInputBuffer
FlushConsoleInputBuffer
MS-HAID
\_win32\_flushconsoleinputbuffer
base.flushconsoleinputbuffer
consoles.flushconsoleinputbuffer
MSHAttr
PreferredSiteName:MSDN
PreferredLib:/library/windows/desktop
ms.assetid 6f7832d6-1fb2-4ca8-bd07-43123c990851
topic_type
apiref
api_name
FlushConsoleInputBuffer
api_location
Kernel32.dll
API-MS-Win-Core-Console-l2-1-0.dll
KernelBase.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
api_type
DllExport

FlushConsoleInputBuffer function

[!INCLUDE not-recommended-banner]

Flushes the console input buffer. All input records currently in the input buffer are discarded.

Syntax

BOOL WINAPI FlushConsoleInputBuffer(
  _In_ HANDLE hConsoleInput
);

Parameters

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

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

Tip

This API is not recommended and does not have a virtual terminal equivalent. Attempting to empty the input queue all at once can destroy state in the queue in an unexpected manner.

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

Low-Level Console Input Functions

GetNumberOfConsoleInputEvents

PeekConsoleInput

ReadConsoleInput

WriteConsoleInput