--- 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](./includes/not-recommended-banner.md)] Flushes the console input buffer. All input records currently in the input buffer are discarded. ## Syntax ```C 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](console-buffer-security-and-access-rights.md). ## 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**](/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror). ## Remarks > [!TIP] > This API is not recommended and does not have a **[virtual terminal](console-virtual-terminal-sequences.md)** 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](console-functions.md) [Low-Level Console Input Functions](low-level-console-input-functions.md) [**GetNumberOfConsoleInputEvents**](getnumberofconsoleinputevents.md) [**PeekConsoleInput**](peekconsoleinput.md) [**ReadConsoleInput**](readconsoleinput.md) [**WriteConsoleInput**](writeconsoleinput.md)