I am making a screensave application that requires a password to exit and resume
using the computer but right now you can just close it making it useless...
Also i was wondering how to make the console window fullscreen...
/* A simple little program to protect the screen
or run prechosen exe's
V1.1
by Ian
*/
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
/*
In future versions:
*No close button
*Full screen
*user input for exe (like run)
*User chosen password that saves after first time
*Password changer
*/
///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
//"pass" is the password
#define password "pass"
#include <iostream>
#include <fstream>
#include <string.h>
usingnamespace std;
int main()
{
//Variables
int correct, menu;
char input[50], iinput[50];
//For screensaver and wrong password
loop:;
//Prompt for password
printf("What is your password? : ");
cin >> input;
correct=strcmp(input, password);//compare input to password, correct=0
//display menu if correct
if (correct==0)
{
printf("Welcome\n");
printf("1 would you like to open Aerofighter\n");
printf("2 or Mage\n");
printf("3 or screensaver\n");
printf("4 or leave \n\n");
cin >> menu;
switch (menu){
case 1: system("AeroFighter.exe");//keep these in same folder as this exe
case 2: system("Mage_NoAudio.exe");
case 3: system("cls"); goto loop;
case 4: return 0;
}
}
else //if incorrect password
{
goto loop;
}
return 0;
}
its imposible in the console, I think... you need a graphics library for that or you could just select prompt for password after stanby or something like that from properties