Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than kernel32, prefix the name with the module name and a period.
//C# method to flush console input
public static void Flush()
{
//"CONIN$" will allow you to grab the input buffer regardless if it is being redirected.
//0x40000000 | 0x80000000 - corresponds to GENERIC_READ | GENERIC_WRITE
//0x00000001 - FILE_SHARE_READ - seems to be required to get the buffer correctly.
//IntPtr.Zero - According to MSDN - "bInheritHandle member of the SECURITY_ATTRIBUTES structure must
//be TRUE if the console is inherited"
//if the console is not inherited, this can be null (IntPtr.Zero seen here)
//3 - OPEN_EXISTING - recommended by MSDN to get the buffer correctly
//The last two parameters are ignored in this case according to MSDN
//throw an error if the input buffer is not obtained
Int32 error = Marshal.GetLastWin32Error();
if (error != 0) throw new System.ComponentModel.Win32Exception(error);
FlushConsoleInputBuffer(inBuffer);
}
Alternative Managed API:
Do you know one? Please contribute it!
The FlushConsoleInputBuffer API
10/8/2014 6:22:16 AM - Misto-170.218.219.22
The FlushConsoleInputBuffer API
10/8/2014 6:22:16 AM - Misto-170.218.219.22
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).