1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#include <cstdlib>
#include <iostream>
#include <windows.h>
using namespace std;
int main(int argc, char *argv[])
{
/*Sets the window to full screen*/
keybd_event(VK_MENU, 0x38, 0, 0);
keybd_event(VK_RETURN, 0x1c, 0, 0);
keybd_event(VK_RETURN, 0x1c, KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU, 0x38, KEYEVENTF_KEYUP, 0);
HWND CurrentWin;
CurrentWin = GetForegroundWindow();
HANDLE consol;
consol = GetStdHandle(STD_OUTPUT_HANDLE);
/*Sets the text to red on a black background*/
SetConsoleTextAttribute(consol,FOREGROUND_RED);
cout << "Hello World\n";
/*Sets the text to green on a black background*/
SetConsoleTextAttribute(consol,FOREGROUND_GREEN);
cout << "Hello World\n";
/*Sets the text to blue on a black background*/
SetConsoleTextAttribute(consol,FOREGROUND_BLUE);
cout << "Hello World\n";
/* Sets the text to bright green ("FOREGROUND_INTENSITY") and the background to red */
SetConsoleTextAttribute(consol,FOREGROUND_GREEN |FOREGROUND_INTENSITY| BACKGROUND_RED);
cout << "BOO!\n";
/*Sets the text to text to green on a bright blue background*/
SetConsoleTextAttribute(consol,FOREGROUND_GREEN|BACKGROUND_BLUE|BACKGROUND_GREEN|BACKGROUND_INTENSITY);
cout << "HI!\n";
SetForegroundWindow(CurrentWin);
/* "Press any key to continue... */
system("PAUSE");
return EXIT_SUCCESS;
}
|