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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
#include <iostream>
#include <windows.h>
#include <time.h>
using namespace std;
int main()
{
system("color 02");
system("cls");
char mainMenuChoice, choicePage1, choicePage2, choicePage3, choicePage4, choicePage5;
char quit_exe, apps, shutoff, colors;
mainmenu:
system("cls");
cout << " TAT Main Menu TAT 1.5.3" << endl;
cout << " _______________________________________________" << endl;
cout << " + Type 'menu' at any time if you wish to +" << endl;
cout << " + return to this menu. +" << endl;
cout << " + +" << endl;
cout << " + Type 'quit_exe' at any time to exit. +" << endl;
cout << " +_____________________________________________+" << endl;
cout << " + Type 'apps' to view batch applications. +" << endl;
cout << " +_____________________________________________+" << endl;
cout << " + Type 'shutoff' to shut down your PC. +" << endl;
cout << " +_____________________________________________+" << endl;
cout << " + Type 'colors' to view alternate colors. +" << endl;
cout << " +_____________________________________________+" << endl << endl;
time_t tim; //create variable of time_t
time(&tim); //pass variable tim to time function
cout << ctime(&tim); // this translates what was returned from time() into a readable format
cout << " _________________________________" << endl << endl;
cin >> mainMenuChoice;
if (mainMenuChoice = quit_exe)
goto exit;
//if (mainMenuChoice = apps)
//goto apps;
if (mainMenuChoice = shutoff)
goto sd;
if (mainMenuChoice = colors)
goto color;
else
cout << " Invalid selection, try again." << endl;
system("pause");
goto mainmenu;
sd:
char shut_down_confirm, y, n;
system("cls");
cout << " Really shut down your computer? y/n" << endl << endl;
cin >> shut_down_confirm;
if (shut_down_confirm == y)
cout << "TAT recieved a request to turn off this PC." << endl;
system("shutdown -s -f -t 10 -c");
if (shut_down_confirm == n)
goto mainmenu;
else
cout << " Invalid selection." << endl;
system("pause");
goto sd;
color:
char color, A, B, C, D, E, F;
char front, back;
cout << " Choose from the following text colors:" << endl << endl;
cout << " 1=blue 9=light blue" << endl << endl;
cout << " 2=green A=light green" << endl << endl;
cout << " 3=aqua B=light aqua" << endl << endl;
cout << " 4=red C=light red" << endl << endl;
cout << " 5=violet D=light violet" << endl << endl;
cout << " 6=yellow E=light yellow" << endl << endl;
cout << " 7=white F=brigth white (best for contrast)" << endl << endl;
cout << " 8=gray" << endl << endl;
cin >> color;
SetConsoleTextAttribute ( GetStdHandle ( STD_OUTPUT_HANDLE ) , color );
system("pause");
system("cls");
goto mainmenu;
exit:
system("pause");
return 0;
}
| |