![]() |
| ||
| Change text color using visual c++ I'm using visual c++ compiler and I want to change the text color in my c++ dos program. What choices do I have if i don't wanna use system function (example: system("color 0a"))? |
| ||
| Re: Change text color using visual c++ conio.h It has a lot funtions for console input/output.Take a look at it. TextColor(RED); TextBackground(BLUE); The color values range from 0-15 with 0 being black and 15 being white warning,i am not too sure of the funtion names,been a while since i used this, though i used it almost everywhere, man time flies |
| ||
| Re: Change text color using visual c++ Thanks, FireNet. But the trick doesn't work for microsoft visual c++ 6.0 compiler, is there any function that i can use to change text color using visual c++? |
| ||
| Re: Change text color using visual c++ Quote:
#define BLACK 0 This works in Microsoft c++ |
| ||
| Re: Change text color using visual c++ 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:
|
| ||
| Re: Change text color using visual c++ I used this one to save me some time This is not Visual C++ dependant, I use this with DEv-C++ as well, you just need the windows header enum Colors { blue=1, green, cyan, red, purple, yellow, grey, dgrey, hblue, hgreen, hred, hpurple, hyellow, hwhite };Then to output in color you would just do coutc(red, "This is in red!"); |
| ||
| Re: Change background color using visual c++ HELLO Can sombody tell me how can i chang the color of concol background???? Quote:
|
| ||
| Re: Change text color using visual c++ Try this. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), BACKGROUND_RED BACKGROUND_INTENSITY); You can change RED to GREEN or BLUE and BACKGROUND to FOREGROUND. If you want to mix colors you just separate them with a | |
| ||
| Re: Change background color using visual c++ Quote:
|
| ||
| Re: Change text color using visual c++ Hi Thank you for your reply mostermand but that code didnt work in microsoft vitual c++(I dont know why??). after searching in the net for hours I found a useful site about win32 consul application, I thought that it would be very useful for beginners . http://www.adrianxw.dk/SoftwareSite/index.html Bye |
| All times are GMT -4. The time now is 8:55 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC