From 64ea9aad7ea948cf80b0ca65ebe85942bb265c27 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 9 Dec 2021 07:15:55 +0800 Subject: [PATCH] - enhancement: the console pauser will clear STDIN when program finished --- tools/ConsolePauser/ConsolePauser.dev | 2 +- tools/ConsolePauser/main.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/ConsolePauser/ConsolePauser.dev b/tools/ConsolePauser/ConsolePauser.dev index 6a50e0e5..ba086be3 100644 --- a/tools/ConsolePauser/ConsolePauser.dev +++ b/tools/ConsolePauser/ConsolePauser.dev @@ -28,7 +28,7 @@ CustomMakefile = IncludeVersionInfo = 0 SupportXPThemes = 0 CompilerSet = 0 -CompilerSettings = 000000a000110000000010000 +CompilerSettings = 000000a000110000000001000 UnitCount = 1 UsePrecompiledHeader = 0 PrecompiledHeader = diff --git a/tools/ConsolePauser/main.cpp b/tools/ConsolePauser/main.cpp index a09d01bb..a1d1e536 100644 --- a/tools/ConsolePauser/main.cpp +++ b/tools/ConsolePauser/main.cpp @@ -61,6 +61,8 @@ void PauseExit(int exitcode, bool reInp) { SetStdHandle(STD_INPUT_HANDLE,hInp); freopen("CONIN$","r",stdin); } + FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); + fflush(stdin); printf("\n"); printf("Press ANY key to exit..."); getch();