   Non-halting console input?
  I currently use the following code for a logger:#define WIN32_LEAN_AND_MEAN#include <windows.h>#include <fcntl.h>#include <io.h>#include <string> void CreateLogWindow( ){int nConHandle;long lStdHandle;CONSOLE_SCREEN_BUFFER_INFO cInfo;FILE* pFile;AllocConsole( );GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &cInfo );cInfo.dwSize.Y = 500;SetConsoleScreenBufferSize( GetStdHandle( STD_OUTPUT_HANDLE ), cInfo.dwSize );lStdHandle = (long) GetStdHandle( STD_OUTPUT_HANDLE );nConHandle = _open_osfhandle( lStdHandle, _O_TEXT );pFile = _fdopen( nConHandle, "w" );*stdout = *pFile;setvbuf( stdout, NULL, _IONBF, 0 );SetConsoleTitle( "Log Window" );}void Log( std::string sMessage ){printf( sMessage.c_str(), "" );}It creates a console window and redirects output to it. I was wondering if  I could also redirect input and read this in without halting the program (doesn't scanf() halt until something is entered?)Thanks.   
  Hey Smit: Totally not an expert on this stuff, but, I managed to pull some stuff up off this website.Another thing to consider is starting a seperate thread and using a blocking input on one thread while the other runs concurrently in the background.The problem with the first approach is that if you are constantly using a non-blocking IO call, you are likely going to keep coming back to it, meaning big (noticeably so) performance hits.Hope this helpsJ   ;  non-blocking console IO generally involves using kbhit or select followed by a blocking read (which kbhit/select guarantees to read something and not block).   