View Single Post
Join Date: Jan 2009
Posts: 11
Reputation: |\|asrin is an unknown quantity at this point 
Solved Threads: 0
|\|asrin |\|asrin is offline Offline
Newbie Poster

Re: Change background color using visual c++

 
0
  #7
Jan 22nd, 2009
HELLO
Can sombody tell me how can i chang the color of concol background????
Originally Posted by MagikMan74 View Post
Of course, if you're just wanting to change the color as you're typing it, then the above is a bit much. A simpler way would be to use this:
  1.  
  2. #include <windows.h>
  3. #include <iostream.h>
  4.  
  5. int main()
  6. {
  7. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0); //replace the 0 with a number for the color you want
  8.  
  9. cout << "Your text here" << endl;
  10.  
  11. return 0;
  12. }
Reply With Quote