Skip to content

Instantly share code, notes, and snippets.

@astrcomp
Created April 26, 2016 07:49
Show Gist options
  • Select an option

  • Save astrcomp/f30b2172f0594e0cb239040f717ecae0 to your computer and use it in GitHub Desktop.

Select an option

Save astrcomp/f30b2172f0594e0cb239040f717ecae0 to your computer and use it in GitHub Desktop.
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
HANDLE io = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(io, BACKGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY);
printf("Test string: red on blue\n");
printf("dasdasdsdasdada ");
GetConsoleScreenBufferInfo(io, &csbiInfo);
printf("%d %d", csbiInfo.dwCursorPosition.X, csbiInfo.dwCursorPosition.Y);
COORD cursorPos;
cursorPos.X = 30;
cursorPos.Y = 3;
SetConsoleCursorPosition(io, cursorPos);
// Выводим строку
printf("Test string at position (30, 3)");
// Повторяем с другими координатами...
cursorPos.X = 15;
cursorPos.Y = 8;
SetConsoleCursorPosition(io, cursorPos);
cout << "t ";
printf("Test string at position (15, 8)");
getchar();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment