Platform SDK: Files and I/O

FlushConsoleInputBuffer

The FlushConsoleInputBuffer function flushes the console input buffer. All input records currently in the input buffer are discarded.

BOOL FlushConsoleInputBuffer(
  HANDLE hConsoleInput   // handle to console input buffer
);

Parameters

hConsoleInput
[in] Handle to the console input buffer. The handle must have GENERIC_WRITE access.

Return Values

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.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Wincon.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

Consoles and Character-Mode Support Overview, Console Functions, GetNumberOfConsoleInputEvents, PeekConsoleInput, ReadConsoleInput, WriteConsoleInput