// Ждем нажатия клавиши END и всё. В случае нажатия, // выходим из цикла и потока while ( ! GetAsyncKeyState ( VK_END ) & 1 ) { std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( 10 ) ) ; } FreeConsole ( ) ; Sleep ( 2000 ) ; FreeLibraryAndExitThread ( static_cast ( lpReserved ) , 0 ) ; return TRUE ;