Voilà mon morceau de code :
#include
#include <windows.h>
using namespace std ;
const HANDLE MaConsoleEcran = GetStdHandle ( STD_INPUT_HANDLE ) ;
const HANDLE MaConsoleClavier = GetStdHandle ( STD_OUTPUT_HANDLE ) ;
const int NOIR = 0;
const int BLANC = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY;
const int BLEU = FOREGROUND_BLUE ;
const int ROUGE = FOREGROUND_RED;
const int ORANGE = FOREGROUND_RED | FOREGROUND_INTENSITY;
const int VERT = FOREGROUND_GREEN ;
const int MARRON = FOREGROUND_RED | FOREGROUND_GREEN;
const int JAUNE = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
int fond = BLEU;
int texte = JAUNE;
void CouleurTexteFond( int CouleurFond , int CouleurTexte );
void CouleurFond(int CouleurFond);
void CouleurTexte(int CouleurTexte);
void CouleurTexteFond( int CouleurFond , int CouleurTexte )
{
fond = CouleurFond * 0x0010 ;
texte = CouleurTexte ;
SetConsoleTextAttribute(MaConsoleEcran, texte | fond ) ;
}
void CouleurTexte(int CouleurTexte )
{
texte = CouleurTexte ;
SetConsoleTextAttribute(MaConsoleEcran, texte | fond ) ;
}
void CouleurFond( int CouleurFond )
{
fond = CouleurFond * 0x0010 ;
SetConsoleTextAttribute(MaConsoleEcran, texte | fond ) ;
}
int main()
{
cout << "Salut dd" ;
system("PAUSE");
return 0;
}
donc d'après ce code mon fond devrais être bleu et mon texte jaune mais rien ne change pk ? ou est mon erreur ?
Afficher la suite