You are not logged in.

  • Login

Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, August 21st 2007, 11:30pm

Farben in der Konsole (windows)

nihao!

hab folgendes problem (google wird iwie nix, vor allem weil ich net weiß nach was ich suchen soll...):

also
jeder von euch kennt bestimmt das progämmchen "edit" unter cmd bei windows.
schaut euch das ma schnell an...
da sind ja mehrere Farben verwendet...
also hintergrundfarbe is anders und die schriftfarbe...
jetzt frage ich euch...
wie um gotteswillen mache ich sowas mit c++?
ohne großmächtig viel header...
wenn jmd weiß bin ich dankbar :love:

-pocky-

2

Wednesday, August 22nd 2007, 10:29am

Das geht über die WinAPI Funktion SetConsoleTextAttribute

Dafür brauchst du das Windows Handle von stdout, welches du per

C/C++ Quellcode

1
HANDLE hStdout = GetStdHandle (STD_OUTPUT_HANDLE);

bekommst.

Probiere als Wert die Konstante FOREGROUND_GREEN aus

viel Erfolg

3

Wednesday, August 22nd 2007, 12:05pm

ah, ok danke ^^
ma sehen...
ich kenn mich mit der winAPI absoslut NULL aus :thumbdown:
naja, hab ich ma wieder was zu lernen x3

Similar threads

Social bookmarks