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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
#include "stdafx.h"
#include <iostream>
#include <windows.h>
//#include <algorithm>
//#include <stdio.h>
void rpeatFunc()
int main()
{
using namespace std;
// Time variables.
int AIM_TIME;
// Title screen. still CMD oriented but understand able.
cout << endl;
cout << " ________________________________________________________ \n";
cout << "| ____________________________________________________ |\n";
cout << "| | ________________________________________________ | |\n";
cout << "| | | ____________________________________________ | | |\n";
cout << "| | | | | | | |\n";
cout << "| | | | | | | |\n";
cout << "| | | |_____________________________________________| | | |\n";
cout << "| | |________________________________________________| | |\n";
cout << "| |____________________________________________________| |\n";
cout << "|________________________________________________________|\n";
cout << endl;
cout << " ________________________________________________________ \n";
cout << "| 1) 10 minutes delay |\n" << "\a";
cout << "| 2) 20 minutes delay |\n";
cout << "| 3) 40 minutes delay |\n";
cout << "| 4) 60 minutes delay |\n";
cout << "| Please enter a time: ";
cin >> AIM_TIME;
switch (AIM_TIME)
{
case 1:
{
printf ( "Delaying process for 10 minutes\n" );
Sleep ( 600000 );
printf ( "Done!\n" );
cout << "\a \a \a";
const char* urlA = "http://www.cplusplus.com/";
wchar_t urlW[ MAX_PATH ];
std::copy( urlA, urlA + lstrlenA( urlA ) + 1, urlW );
if ((int)ShellExecuteW( NULL, L"open", urlW, NULL, NULL, SW_SHOW ) < 32);
break;
}
case 2:
{
printf ( "Delaying process for 20 minutes\n" );
Sleep ( 1200000 );
printf ( "Done!\n" );
cout << "\a \a \a";
const char* urlB = "http://www.cplusplus.com/";
wchar_t urlW[ MAX_PATH ];
std::copy( urlB, urlB + lstrlenA( urlB ) + 1, urlW );
if ((int)ShellExecuteW( NULL, L"open", urlW, NULL, NULL, SW_SHOW ) < 32);
break;
}
case 3:
{
printf ( "Delaying process for 40 minutes\n" );
Sleep ( 2400000 );
printf ( "Done!\n" );
cout << "\a \a \a";
const char* urlC = "http://www.cplusplus.com/";
wchar_t urlW[ MAX_PATH ];
std::copy( urlC, urlC + lstrlenA( urlC ) + 1, urlW );
if ((int)ShellExecuteW( NULL, L"open", urlW, NULL, NULL, SW_SHOW ) < 32);
break;
}
case 4:
{
printf ( "Delaying process for 60 minutes\n" );
Sleep ( 3600000 );
printf ( "Done!\n" );
cout << "\a \a \a";
const char* urlD = "http://www.cplusplus.com/";
wchar_t urlW[ MAX_PATH ];
std::copy( urlD, urlD + lstrlenA( urlD ) + 1, urlW );
if ((int)ShellExecuteW( NULL, L"open", urlW, NULL, NULL, SW_SHOW ) < 32);
break;
}
}
return 0;
}
|