- GetStdHandle
- STD_OUTPUT_HANDLE
- INVALID_HANDLE_VALUE
- CONSOLE_CURSOR_INFO
- SetConsoleCursorInfo
- GetConsoleCursorInfo
- SetConsoleMode
- GetConsoleMode
- ENABLE_VIRTUAL_TERMINAL_PROCESSING
Код: Выделить всё
#ifndef CONSOLE_OUTPUT_COMMON_H
#define CONSOLE_OUTPUT_COMMON_H
#include
//#include
#include
#define _WINSOCKAPI_
#include
namespace ConsoleOutputCommon {
void clrLine();
void moveCursorTopLeft();
void replaceLine(std::string s);
void clrScreen();
void prepareWindowsConsole();
void clrRemainingScreen();
}
#endif // !CONSOLE_OUTPUT_COMMON_H
Код: Выделить всё
#include "ms_windows_console_output_common_20200819.h"
void ConsoleOutputCommon::clrLine() {
printf("\x1B[2K");
}
void ConsoleOutputCommon::moveCursorTopLeft() {
printf("\x1B[1;1H");
}
void ConsoleOutputCommon::replaceLine(std::string s) {
printf("\x1B[2K");
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/69085534/how-to-use-windows-h-on-ubuntu[/url]