   C++ Console Question
  I'm building a game in a Cplusplus console window (mostly for the challenge and experience of designing with constraints) and I'm looking for a way to have more control over the console window itself. I'd like to know if the following is possible, and if so, a starting point for research besides a blind google search. Any help is appreciated.1. Scroll the console window (for example, if the amount of text in the window goes over 25 lines, it forces the scroll bar to stay at the top)2. Set the colour of certain parts of text (right now, the entire contents of the console is treated something like a video buffer, a 2D array of chars), I don't mind programming a bastardized "shader" to work with this3. Change the size of the console window in the program such that if the program is distributed, the size of the console window that appears for them will be whatever I set it toThanks!   
  Curses is a C library for doing guis on the command line. It can do everything you mention except #3 I think.   ;  The answer to your question has much less to do with C++ or any programming language and more to do with the application you're trying to control.  The 'console window' you're talking about is an application used to display the stdout (and likely stderr) stream from a C++ application and handles cooking the stdin of the same.  If you want to control the behaviour of that console application, you will have to find out from the application vendor or maintainer how to do that.For example, if you're using one of the Microsoft Windows products and some sort of MS-DOS CLI emulator window, you can probably use 'ANSI' codes to manipulate the text colour and position within the display window, and you may be able to use primitive Windows API messaging to control the size of the window and position of its controls.  So some things you can do by inserting control codes in-band in your text output stream and other things require out-of-band messaging.The same principals apply to other applications on other application platforms.  Even if your 'console window' is on a VT100 copnnected to a serial port.   ;  So if I'm using windows XP to open the console window, It's a matter of getting the handle to the console window (using the windows API) and manipulating it from there?   ;  You can do alot with the console stuff.I used these functions when I was playing around with console stuff in windows.Just note, this is windows specific. Something like ncurses wraps all of these commands for both linux/mac/windows.void clrscr(){COORD coordScreen = { 0, 0 }; DWORD cCharsWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD dwConSize; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);   GetConsoleScreenBufferInfo(hConsole, &csbi); dwConSize = csbi.dwSize.X * csbi.dwSize.Y; FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten); GetConsoleScreenBufferInfo(hConsole, &csbi); FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten); SetConsoleCursorPosition(hConsole, coordScreen); }//// Moves the cursor to x, y in console window// ie x=left\right y=top\bottom//void gotoxy(int x, int y){COORD point;point.X = x; point.Y = y;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), point);}//// Set text and background colors//void setrgb(int color){SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color );};  In my personal opinion, when you get to doing things like this then I'd decide it's time to move on to win32, or similar. You could simply have a window with a large scrolling box of text, you'd have much better control over it all and I imagine the end user would better appreciate the visual appearance of the product too.   ;  Very true dmatter, I was waiting for someone to bring this up :PThe point of the game is more of a Game Design and Engineering exercise for me. I want to see what it's like to have a design, plug it into a system (that cant be changed, just worked with), find the constraints that limit/change your design, and redesign around that, while getting some more code under my belt and having a tangible product in the end.thanks for your input tho.   ;Quote:Original post by KulSeranYou can do alot with the console stuff.I used these functions when I was playing around with console stuff in windows.Just note, this is windows specific. Something like ncurses wraps all of these commands for both linux/mac/windows.*** Source Snippet Removed ***Thanks for the code,which libraries do I need for that? I'm not too familiar with using windows   ;  I suggest you take a look at the Droyen Library. It is like a curses library, but with viewport and the ability to set console size. It is originally intended for rogue-like but I think its functionality can be used for any text-based games.Hope this helps!   