Kod był wyświetlany 3019 razy.
/*
Name: Zmiana koloru tła i tekstu
Copyright: GPL GNU
Date: 14-12-2007 22:59:43
Description:
*/
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
int i=0;
cout<<"\n\n\tTO jest tekst.......................\n";
/*---------------------------Zmiana koloru tekstu---------------------*/
HANDLE konsola = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute (konsola,1);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,2);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,3);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,4);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,5);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,6);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,7);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,8);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,9);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,10);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,11);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,12);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,13);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,14);
cout << "\n\n\tTO jest tekst.......................\n";
SetConsoleTextAttribute (konsola,15);
cout << "\n\n\tTO jest tekst.......................\n";
cout<<"\n\n";
system("pause");
/*------------------------Zmiana koloru tła -------------------*/
cout<<"\n\nZmiana koloru tekstu.......\n\n";
system("COLOR E");
getchar();
cout<<"\n\nKolejna zmiana koloru tekstu i tła";
system("COLOR F1");
cout<<"\n\nPo nacisnieciu dowolnego klawisz,zostanie wyswietlona pomoc dla polecenia COLOR....";
system("pause");
system("cls");
system("COLOR, i");
return 0;
}
Pobierz plik tekstowy