Code: Select all
//HEADER FILES INCLUSION
#include<dos.h>
#include<iostream.h>
#include<dir.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<fstream.h>
#include<conio.h>
#include<dos.h>
//VARIABLES DECLARED
int src=30,g,i,j,F;
char dname[20],passw[10],ce;
char fname[15],fn[10],ch,N[10];
char str[10],c,z,k;
int num=(80-strlen(str))/2;
//STRUCTURES DECLARED
struct userid
{
char uname[20],password[10];
}L,L1;
struct col
{
int c1,c2,c3;
}Q;
struct colors
{
int cl1,cl2,cl3;
}C;
struct files
{
char filn[20];
}Files;
struct theme
{
int s,sl,sf,t,d;
}TH;
//FUNCTION DECLARATIONS
int settheme() //TO SET THEME FOR THE DESKTOP
{
int s1,s2,s3,s4,s5;
theme:
int th1;
char th;
ifstream y("THEME.DAT");
while(y)
{
y.read((char*)&TH,sizeof(TH));
}
s1=TH.s;
s2=TH.sl;
s3=TH.sf;
s4=TH.t;
s5=TH.d;
ofstream the("THEME.DAT");
clrscr();
cout<<"\n1.GENERAL MXP Operating System";
cout<<"\n2.BLUES";
cout<<"\n3.REDS";
cout<<"\n4.GREYS";
cout<<"\n5.MODIFY";
cout<<"\n0.EXIT\t\t";
cin>>th1;
if(th1==0)
return -1;
else if(th1==1)
{
gotoxy(10,37);
cout<<"(A)pply?";
cin>>th;
if(th=='a'||th=='A')
{
TH.s=TH.sl=TH.sf=TH.t=TH.d=15;
the.write((char*)&TH,sizeof(TH));
src=1;
return src;
}
else
{
TH.s=s1;
TH.sl=s2;
TH.sf=s3;
TH.t=s4;
TH.d=s5;
goto theme;
}
}
else if(th1==2)
{
gotoxy(10,37);
cout<<"(A)pply?";
cin>>th;
if(th=='a'||th=='A')
{
TH.s=TH.sl=TH.sf=TH.t=TH.d=1;
the.write((char*)&TH,sizeof(TH));
src=1;
return src;
}
else
{
TH.s=s1;
TH.sl=s2;
TH.sf=s3;
TH.t=s4;
TH.d=s5;
goto theme;
}
}
else if(th1==3)
{
gotoxy(10,37);
cout<<"(A)pply?";
cin>>th;
if(th=='a'||th=='A')
{
TH.s=TH.sl=TH.sf=TH.t=TH.d=3;
the.write((char*)&TH,sizeof(TH));
src=1;
return src;
}
else
{
TH.s=s1;
TH.sl=s2;
TH.sf=s3;
TH.t=s4;
TH.d=s5;
goto theme;
}
}
else if(th1==4)
{
gotoxy(10,37);
cout<<"(A)pply?";
cin>>th;
if(th=='a'||th=='A')
{
TH.s=TH.sl=TH.sf=TH.t=TH.d=7;
the.write((char*)&TH,sizeof(TH));
src=1;
return src;
}
else
{
TH.s=s1;
TH.sl=s2;
TH.sf=s3;
TH.t=s4;
TH.d=s5;
goto theme;
}
}
else if(th1==5)
{
cout<<"\n";
cout<<"\nBLUE ---> 1";
cout<<"\nGREEN ---> 2";
cout<<"\nCYAN ---> 3";
cout<<"\nRED ---> 4";
cout<<"\nMAGENTA ---> 5";
cout<<"\nBROWN ---> 6";
cout<<"\nLIGHTGRAY ---> 7";
cout<<"\nDARKGRAY ---> 8";
cout<<"\nLIGHTBLUE ---> 9";
cout<<"\nLIGHTGREEN ---> 10";
cout<<"\nLIGHTCYAN ---> 11";
cout<<"\nLIGHTRED ---> 12";
cout<<"\nLIGHTMAGENTA---> 13";
cout<<"\nYELLOW ---> 14";
cout<<"\nWHITE ---> 15";
gotoxy(5,30);
cout<<"Start Color";
gotoxy(5,31);
cout<<"Start Liners";
gotoxy(5,32);
cout<<"Start Bar Fonts";
gotoxy(5,33);
cout<<"Time";
gotoxy(5,34);
cout<<"Date";
a1:
gotoxy(40,30);
cin>>TH.s;
if(TH.s>15||TH.s<1)
goto a1;
a2:
gotoxy(40,31);
cin>>TH.sl;
if(TH.sl>15||TH.sl<1)
goto a2;
a3:
gotoxy(40,32);
cin>>TH.sf;
if(TH.sf>15||TH.sf<1)
goto a3;
a4:
gotoxy(40,33);
cin>>TH.t;
if(TH.t>15||TH.t<1)
goto a4;
a5:
gotoxy(40,34);
cin>>TH.d;
if(TH.d>15||TH.d<1)
goto a5;
gotoxy(10,37);
cout<<"(A)pply?";
cin>>th;
if(th=='a'||th=='A')
{
the.write((char*)&TH,sizeof(TH));
src=1;
return src;
}
else
{
TH.s=s1;
TH.sl=s2;
TH.sf=s3;
TH.t=s4;
TH.d=s5;
goto theme;
}
}
return src;
}
void shutdown() //TO SHUT THE SOFTWARE
{
clrscr();
gotoxy(20,25);
int i=10;
char text1[]={"PLEASE "},text2[]={"WAIT "};
char text3[]={"WHILE "},text4[]={"THE "};
char text5[]={"OPERATING SYSTEM "},text6[]={"SHUTS DOWN...."};
do
{
for(int i0=1;i0<11;i0++)
{
gotoxy(20,20);
textcolor(i0+5);
cprintf(text1);
textcolor(i0+4);
cprintf(text2);
textcolor(i0+3);
cprintf(text3);
textcolor(i0+2);
cprintf(text4);
textcolor(i0+1);
cprintf(text5);
textcolor(i0);
cprintf(text6);
delay(120);
}
i+=10;
}while(i<=70);
exit(0);
}
int note() //TO EXECUTE NOTEPAD
{
fir:
clrscr();
fstream filesrite("FILES.DAT",ios::out|ios::ate);
char fil[20];
char ch=' ',uch=' ';
cout<<"\n\n";
cout<<"+---------+ +---------+ +----------+ +----------+";
cout<<"\n| New | | Open | | Help | | Exit |";
cout<<"\n| ~ | | ~ | | ~ | | ~ |";
cout<<"\n+---------+ +---------+ +----------+ +----------+";
gotoxy(10,20);
cout<<"IF YOU ARE A NEW USER PLEASE READ HELP AND THEN PROCEED WITH NOTEPAD";
uch=getch();
if(uch=='n'||uch=='N')
{
ofstream file("TEMP.TXT");
clrscr();
while((ch=getc(stdin))!=EOF)
{
file.put(ch);
}
cout<<"\n\nWant to save?(Y to save any other key close SAVE)";
ch=getch();
if(ch=='y'||ch=='Y')
{
cout<<"\n\nEnter the file name to be saved\t";
gets(fil);
strcat(fil,".TXT");
strcpy(Files.filn,fil);
filesrite.write((char *)&Files,sizeof(Files));
rename("TEMP.TXT",fil);
remove("TEMP.TXT");
cout<<"\n\nSaved";
getch();
filesrite.close();
goto fir;
}
else
goto fir;
}
else if(uch=='h'||uch=='H')
{
clrscr();
cout<<"\nIf you want to create any text file keep typing the text and if you want to stop working press CTRL+Z";
cout<<"\n\nPress any other key to exit HELP";
getch();
goto fir;
}
else if(uch=='e'||uch=='E')
{
src=1;
return src;
}
else if(uch=='o'||uch=='O')
{
clrscr();
cout<<"Enter the file name to be opened";
char fil[20],ch;
gets(fil);
strcat(fil,".TXT");
ifstream f(fil);
if(fil)
{
cout<<"\nFile found";
cout<<"\n\n\n";
while(f)
{
f.get(ch);
cout<<ch;
}
getch();
goto fir;
}
else
{
cout<<"\nFile not found";
goto fir;
}
}
else
goto fir;
}
void props() //TO CHANGE COLOR (PROPERTIES)
{
fir:
clrscr();
ofstream of("PROPS.TXT",ios::out);
int cl=0;
cout<<"\n+------------------------------+";
cout<<"\n| 1.default1(WHITE) |";
cout<<"\n| 2.default2(BLUE/RED/GREEN) |";
cout<<"\n| 3.custom1(fully GREEN) |";
cout<<"\n| 4.custom2(fully BLUE) |";
cout<<"\n| 5.custom3(fully RED) |";
cout<<"\n| 6.modify |";
cout<<"\n| 0.EXIT |";
cout<<"\n+------------------------------+";
gotoxy(10,15);
cout<<"UR choice?";
gotoxy(20,15);
cin>>cl;
if(cl==0)
{
src=1;
}
else if(cl==1)
{
C.cl1=15;
C.cl2=15;
C.cl3=15;
of.write((char *) &C,sizeof(C));
}
else if(cl==2)
{
C.cl1=1;
C.cl2=4;
C.cl3=2;
of.write((char *) &C,sizeof(C));
}
else if(cl==3)
{
C.cl1=2;
C.cl2=2;
C.cl3=2;
of.write((char *) &C,sizeof(C));
}
else if(cl==4)
{
C.cl1=1;
C.cl2=1;
C.cl3=1;
of.write((char *) &C,sizeof(C));
}
else if(cl==5)
{
C.cl1=4;
C.cl2=4;
C.cl3=4;
of.write((char *) &C,sizeof(C));
}
else if(cl==6)
{
gotoxy(10,20);
cout<< " MXP";
gotoxy(10,21);
cout<<" OPERATING SYSTEM";
gotoxy(10,22);
cout<<" MXP MASTER SOFTWARE";
gotoxy(1,45);
cout<<"1.BLUE\t";
cout<<"2.GREEN\t\t";
cout<<"3.CYAN\t\t";
cout<<"4.RED";
cout<<"\n\n\t5.MAGENTA\t";
cout<<"6.BROWN\t\t";
cout<<"7.GREY\t";
gotoxy(30,20);
cin>>C.cl1;
gotoxy(30,21);
cin>>C.cl2;
gotoxy(30,22);
cin>>C.cl3;
}
else
goto fir;
cout<<"\n\nPREVIEW\t\t";
textcolor(C.cl1);
cprintf(" MXP");
textcolor(C.cl2);
cprintf(" OPPERATING SYSTEM");
textcolor(C.cl3);
cprintf(" MXP MASTER SOFTWARE");
textcolor(WHITE);
cout<<"\n\nSAVE CHANGES?(Y/N)";
char h;
here:
h=getch();
if(h=='y'||h=='Y')
{
of.write((char *) &C,sizeof(C));
src=1;
}
else if(h=='n'||h=='N')
goto fir;
else
goto here;
of.close();
}
int help() //TO EXECUTE SOFTWARE HELP
{
int ch;
min:
clrscr();
gotoxy(5,2);
textcolor(BLUE);
cprintf(" MXP");
textcolor(BLUE);
cprintf(" OPERATING SYSTEM");
textcolor(BLUE);
cprintf(" MXP MASTER SOFTWARE");
gotoxy(30,2);
textcolor(BLUE);
cprintf("&&&&&");
textcolor(BLUE);
cprintf("&&&&&");
gotoxy(29,3);
textcolor(BLUE);
cprintf("&&&&&");
textcolor(BLUE);
cprintf("&&&&&");
textcolor(WHITE);
cout<<"\n\n\n1.HOW TO USE MY COMPUTER";
cout<<"\n\n\n2.HOW TO USE CONTROL PANNEL";
cout<<"\n\n\n3.HOW TO USE THE START";
cout<<"\n\n\n4.CREDITS";
cout<<"\n\n\n0.EXIT";
cout<<"\n\n\nGENERAL INFORMATION ON THE DESKTOP PRESS \\ TO CHANGE THE COLOUR OF THE LOGO";
cout<<"\n\n\nALSO YOU CAN PRESS H TO FIND THIS HELP";
cin>>ch;
if(ch==0)
{
src=1;
return src;
}
else if(ch==1)
{
cout<<"\nOn pressing M on the main screen to enter into the MY COMPUTER window";
cout<<"\n\n\n\nIn MY COMPUTER there are 2 icons GAME and EFFECTS";
cout<<"\n\n\n\nPressing G in MY COMPUTER will activate the GAME";
cout<<"\n\n\tThis GAME is a number guessing game ranging numbers from 1 to 100";
cout<<"\n\n\n\nPressing E in MY COMPUTER will activate the EFFECTS";
cout<<"\n\n\tThis EFFECTS is a dos way of using graphical representation to a text";
cout<<"\n\n\n\nPressing X will exit MY COMPUTER";
}
else if(ch==2)
{
cout<<"\nPress C on the main screen to enter into CONTROL PANNEL";
cout<<"\n\n\nIn CONTROL PANNEL you can add and delete users";
cout<<"\n\n\nPressing U will create a new user and follow the instructions";
cout<<"\n\n\nPressing D will delete an existing account(if present, provided not deleting the same user)";
cout<<"\n\n\nPressing M will modify an existing account(if any)";
}
else if(ch==3)
{
cout<<"\nPress S to activate the start menu";
cout<<"\n\n\nIn START menu you will find NOTEPAD, MY DOCUMENTS, RESTART, LOGOFF, SHUTDOWN, BACK";
cout<<"\n\n\nPressing N will open NOTEPAD where you can create text files";
cout<<"\n\n\nPressing B will go back to the desktop";
cout<<"\n\n\nPressing L will logoff and login as a different user i you want to do so";
cout<<"\n\n\nPressing R will restart the software";
cout<<"\n\n\nPressing S will shutdown the software";
cout<<"\n\n\nPressing M will display the TXT files saved in notepad";
cout<<"\n\n\nOn the start bar, at the right most corner of it you will find date and time";
cout<<"\ndisplayed";
}
else if(ch==4)
{
for(int i=36;i>=10;i--)
{
clrscr();
gotoxy(30,3);
cout<<" CREDITS";
gotoxy(22,i);
cout<<" MXP Master Software :Andrew L Millspaugh Jr";
gotoxy(22,i+3);
cout<<" Supported By :MXP";
gotoxy(20,i+6);
textcolor(BLUE);
cprintf(" MXP Master Software Inc");
textcolor(WHITE);
gotoxy(26,i+9);
cout<<" Mxp Master Software Inc";
gotoxy(20,i+12);
cout<<"MXP Windows 1.0";
delay(125);
}
}
else
goto min;
getch();
src=1;
goto min;
}
void setncolor() //TO EXECUTE COLOR
{
int q1,q2,q3;
ifstream f("PROPS.TXT",ios::in);
while(f)
{
f.read((char *) &Q,sizeof(Q));
q1=Q.c1;
q2=Q.c2;
q3=Q.c3;
}
f.close();
gotoxy(60,40);
textcolor(q1);
cprintf(" MXP");
textcolor(q2);
cprintf("OPERATING SYSTEM");
textcolor(q3);
cprintf(" MXP Master Software Inc");
textcolor(BLUE);
gotoxy(60,42);
cprintf("&&&&&");
textcolor(BLUE);
cprintf("&&&&&");
gotoxy(60,43);
textcolor(BLUE);
cprintf("&&&&&");
textcolor(BLUE);
cprintf("BLUE");
textcolor(BLUE);
src=1;
}
void e(int c1,int r1,char str[10]) //TO EXECUTE THE GRAPHICAL REPRESENTION
{
gotoxy(c1,r1);
cout<<str;
}
int w(char str[10],char c) //TO EXECUTE THE EFFECTS FUNCTION(A PART)
{
m:
fstream filesrite3("FILES.DAT",ios::out|ios::ate);
clrscr();
if(ch=='o'||ch=='O'||ch=='s'||ch=='S')
goto x;
else
{
s:
clrscr();
cout<<"\n\n\nEnter any string of max 10 charectors\t\t";
gets(str);
m1:
clrscr();
cout<<"\nOptions\n\n";
cout<<"\n1.Slide from top to bottom";
cout<<"\n2.Slide from bottom to top";
cout<<"\n3.Slide from left to right";
cout<<"\n4.Slide from right to left";
cout<<"\n5.Merge from right and left and join at the centre";
cout<<"\n6.Merge from top and bottom and join at the centre";
cout<<"\n7.Split from centre and go to right and left";
cout<<"\n8.Split from centre and go to top and bottom";
cout<<"\n9.Split from centre and go to right, left, top and bottom";
cout<<"\n'b' to go BACK";
cout<<"\n'm' to main menu";
c=getch();
}
x:
if(c=='m'||c=='M')
return 1;
else if(c=='b'||c=='B')
goto s;
if(c=='1')
{
for(i=1;i<26;i++)
{
clrscr();
e(num,i,str);
delay(100);
}
}
else if(c=='2')
{
for(i=25;i>0;i--)
{
clrscr();
e(num,i,str);
delay(100);
}
}
else if(c=='3')
{
for(i=1;i<80-strlen(str);i++)
{
clrscr();
e(i,13,str);
delay(100);
}
}
else if(c=='4')
{
for(i=79-strlen(str);i>0;i--)
{
clrscr();
e(i,13,str);
delay(100);
}
}
else if(c=='5')
{
for(i=strlen(str),j=68-strlen(str);i<35;i++,j--)
{
clrscr();
gotoxy(i,13);
cout<<str;
gotoxy(j,13);
cout<<str;
delay(100);
}
}
else if(c=='6')
{
for(i=1,j=26;i<13,j>13;i++,j--)
{
clrscr();
gotoxy(num,i);
cout<<str;
gotoxy(num,j-1);
cout<<str;
delay(100);
}
}
else if(c=='7')
{
for(i=40-strlen(str),j=40-strlen(str);i>1,j<68-strlen(str);i--,j++)
{
clrscr();
gotoxy(i,13);
cout<<str;
gotoxy(j,13);
cout<<str;
delay(100);
}
}
else if(c=='8')
{
for(i=13,j=13;i>1,j<26;i--,j++)
{
clrscr();
gotoxy(num,i);
cout<<str;
gotoxy(num,j);
cout<<str;
delay(100);
}
}
else if(c=='9')
{
for(i=40-strlen(str),j=(40-strlen(str));i>1,j<(68-strlen(str));i--,j++)
{
clrscr();
gotoxy(i,13);
cout<<str;
gotoxy(j,13);
cout<<str;
delay(100);
}
for(i=13,j=13;i>1,j<25;i--,j++)
{
clrscr();
gotoxy(1,13);
cout<<str;
gotoxy(68-strlen(str),13);
cout<<str;
gotoxy(num,i);
cout<<str;
gotoxy(num,j);
cout<<str;
delay(100);
}
}
else
goto m;
if(ch=='n'||ch=='N')
{
char k;
z=c;
cout<<"\nSave Work?(Y/N)";
k=getch();
if(k=='Y'|k=='y')
{
cout<<"\n\nEnter filename\t\t";
gets(fn);
strcpy(Files.filn,fn);
filesrite3.write((char*)&Files,sizeof(Files));
ofstream of(fn);
of<<z<<str;
of.close();
filesrite3.close();
}
else if(k=='n'|k=='N')
{
src=1;
return src;
}
}
return -1;
}
void op1() //TO EXECUTE THE SAVE CHANGES IN EFFECTS IN PROGRAM
{
g:
cout<<"\nEnter saved slideshow file name";
cin>>fname;
ifstream f(fname);
char d;
if(f.bad())
{
cout<<"\n\nPlease enter a valid file name\t\t";
goto g;
}
else
{
f.seekg(0);
while(f)
{
for(F=0;F<10;F++)
{
f.get(N[F]);
}
f>>str;
cout<<"\nString is";cout<<str;
cout<<"\nWant to run?(Y/N)";
b:
d=getch();
if(d=='y'|d=='Y')
{
for(F=0;F<10;F++)
{
w(str,N[F]);
}
goto xl2;
}
else if(d=='n'|d=='N')
goto xl2;
else
goto b;
}
f.close();
}
xl2:
}
void op2() //TO EXECUTE THE OPEN PROPERTY IN EFFECTS
{
g:
cout<<"\nEnter saved file name";
cin>>fname;
ifstream f(fname);
char d;
if(f.bad())
{
cout<<"\n\nPlease enter a valid file name\t\t";
goto g;
}
else
{
f.seekg(0);
while(f)
{
f.get(z);
f.getline(str,10,'\0');
cout<<"\nString is";cout<<str;
cout<<"\nWant to run?(Y/N)";
b:
d=getch();
if(d=='y'|d=='Y')
{
w(str,z);goto xl;
}
else if(d=='n'|d=='N')
goto xl;
else
goto b;
}
f.close();
}
xl:
}
efx() //THE MAIN FUNCTION OF EFFECTS
{
fstream filesrite2("FILES.DAT",ios::out|ios::ate);
clrscr();
for(int z=1;z<13;z++)
{
for(int x=1;x<80;x++)
{
gotoxy(x,z);
cout<<"&";
delay(3);
gotoxy(x,z+13);
cout<<"&";
delay(3);
}
}
for(int i=60;i>30;i--)
{
e(i,13," WELCOME TO MXP OPERATING SYSTEM..");
delay(150);
clreol();
}
delay(500);
for(int y=55;y>30;y--)
{
clreol();
e(y,13," Created by Andrew L Millspaugh.");
delay(150);
}
sound(500);
delay(100);
nosound();
sound(750);
delay(100);
nosound();
sound(500);
delay(750);
nosound();
sound(5000);
delay(100);
nosound();
delay(1000);
char p0;
do
{
n:
ch=' ';
strcpy(str,'\0');
c=' ';
clrscr();
gotoxy(7,6);
cout<<"+-----+";
gotoxy(26,6);
cout<<"+------+";
gotoxy(44,6);
cout<<"+------+";
gotoxy(62,6);
cout<<"+-----------+";
gotoxy(7,8);
cout<<"+-----+";
gotoxy(26,8);
cout<<"+------+";
gotoxy(44,8);
cout<<"+------+";
gotoxy(62,8);
cout<<"+-----------+";
gotoxy(7,7);
cout<<"|(N)ew|";
gotoxy(26,7);
cout<<"|(O)pen|";
gotoxy(44,7);
cout<<"|(E)xit|";
gotoxy(62,7);
cout<<"|(S)lideshow|";
cout<<"\n\n\n\n\nUR choice";
ch=getch();
int dat;
if(ch=='N'|ch=='n')
{
dat=w(str,c);
if(dat==1)
goto n;
}
else if(ch=='o'||ch=='O')
{
char h;
char fname[13];
cout<<"\n(S)lideshow\t\t(N)ormal File";
h=getch();
l1:
if(h=='s'||h=='S')
op1();
else if(h=='N'||h=='n')
op2();
else
goto l1;
}
else if(ch=='e'||ch=='E')
{
src=1;
return(src);
}
else if(ch=='s'||ch=='S')
{
clrscr();
cout<<"\n\n\nEnter any string of max 10 charectors\t\t";
gets(str);
clrscr();
gotoxy(40,2);
cout<<"\nOptions\n\n";
gotoxy(30,3);
cout<<"\n1.Slide from top to bottom";
gotoxy(30,4);
cout<<"\n2.Slide from bottom to top";
gotoxy(30,5);
cout<<"\n3.Slide from left to right";
gotoxy(30,6);
cout<<"\n4.Slide from right to left";
gotoxy(30,7);
cout<<"\n5.Merge from right and left and join at the centre";
gotoxy(30,8);
cout<<"\n6.Merge from top and bottom and join at the centre";
gotoxy(30,9);
cout<<"\n7.Split from centre and go to right and left";
gotoxy(30,10);
cout<<"\n8.Split from centre and go to top and bottom";
gotoxy(30,11);
cout<<"\n9.Split from centre and go to right, left, top and bottom";
gotoxy(30,12);
cout<<"\n0.'m' to go to main menu";
cout<<"\n\n\n";
char N[10];
int F;
for(F=0;F<10;F++)
{
cout<<F+1<<".";
cin>>N[F];
if(N[F]=='m'||N[F]=='M')
goto n;
}
char CH;
long int sec;
cout<<"\nWant to press key after every slide(Y) or auto motion(N)";
CH=' ';
l:
CH=getch();
if(CH=='n'||CH=='N')
{
cout<<"\nDelay by how many seconds?";
cin>>sec;
}
for(F=0;F<10;F++)
{
if(N[F]=='1')
{
for(i=1;i<26;i++)
{
clrscr();
e(num,i,str);
delay(100);
}
}
else if(N[F]=='2')
{
for(i=25;i>0;i--)
{
clrscr();
e(num,i,str);
delay(100);
}
}
else if(N[F]=='3')
{
for(i=1;i<80-strlen(str);i++)
{
clrscr();
e(i,13,str);
delay(100);
}
}
else if(N[F]=='4')
{
for(i=79-strlen(str);i>0;i--)
{
clrscr();
e(i,13,str);
delay(100);
}
}
else if(N[F]=='5')
{
for(i=strlen(str),j=68-strlen(str);i<35;i++,j--)
{
clrscr();
gotoxy(i,13);
cout<<str;
gotoxy(j,13);
cout<<str;
delay(100);
}
}
else if(N[F]=='6')
{
for(i=1,j=26;i<13,j>13;i++,j--)
{
clrscr();
gotoxy(num,i);
cout<<str;
gotoxy(num,j-1);
cout<<str;
delay(100);
}
}
else if(N[F]=='7')
{
for(i=40-strlen(str),j=40-strlen(str);i>1,j<68-strlen(str);i--,j++)
{
clrscr();
gotoxy(i,13);
cout<<str;
gotoxy(j,13);
cout<<str;
delay(100);
}
}
else if(N[F]=='8')
{
for(i=13,j=13;i>1,j<26;i--,j++)
{
clrscr();
gotoxy(num,i);
cout<<str;
gotoxy(num,j);
cout<<str;
delay(100);
}
}
else if(N[F]=='9')
{
for(i=40-strlen(str),j=40-strlen(str);i>1,j<68-strlen(str);i--,j++)
{
clrscr();
gotoxy(i,13);
cout<<str;
gotoxy(j,13);
cout<<str;
delay(100);
}
for(i=13,j=13;i>1,j<25;i--,j++)
{
clrscr();
gotoxy(1,13);
cout<<str;
gotoxy(68-strlen(str),13);
cout<<str;
gotoxy(num,i);
cout<<str;
gotoxy(num,j);
cout<<str;
delay(100);
}
}
z=N[F];
if(CH=='Y'||CH=='y')
getch();
else
delay(sec);
}
cout<<"\nSave Work?(Y/N)";
k=' ';
k=getch();
if(k=='Y'|k=='y')
{
cout<<"\n\nEnter filename\t\t";
gets(fn);
strcpy(Files.filn,fn);
filesrite2.write((char*)&Files,sizeof(Files));
ofstream of(fn);
for(i=0;i<10;i++)
of<<N[i];
of<<str;
of.close();
filesrite2.close();
}
}
else
goto n;
a:
p0=' ';
cout<<"\nWant to continue?(Y/N)";
a1:
p0=getch();
if(p0=='n'||p0=='N')
{
src=1;
return src;
}
fflush(stdin);
fflush(stdout);
}while(p0=='y'||p0=='Y');
getch();
return -1;
}
void game() //TO EXECUTE THE GAME FUNCTION
{
int num,score,gnum;
char ch;
do
{
clrscr();
score=100;
randomize();
num=rand()%100;
int i=5;
do
{
lb:
textcolor(CYAN);
gotoxy(5,5+i);
cprintf("Guess ur number");
textcolor(WHITE);
gotoxy(25,5+i);
cin>>gnum;
if(gnum>100||gnum<0)
{
goto lb;
}
else if(gnum>num)
{
cout<<"\nThe number u hav guessed is greater than the number";
cout<<" i thought";
score-=10;
}
else if(gnum<num)
{
cout<<"\nThe number u hav guessed is lesser than the number";
cout<<" i thought";
score-=10;
}
else
{
cout<<"\nU hav found the answer";
break;
}
i+=4;
}while(score>=10);
if(score==0)
cout<<"\nu did not get to the correct answer and hence ur score is 0";
else
cout<<"\n\n\nU r score is \t\t\t"<<score;
cout<<"\n\nDo you wanna continue? (Y/N)";
ch=getch();
}while(ch=='y'||ch=='Y');
src=1;
}
int MYCOMP() //TO EXECUTE THE MY COMPUTER
{
int stat;
char c;
back:
for(int i=2;i<80;i++)
{
gotoxy(i,1);
cout<<"-";
gotoxy(i,49);
cout<<"-";
}
for(int j=2;j<50;j++)
{
gotoxy(1,j);
cout<<"|";
gotoxy(80,j);
cout<<"|";
}
gotoxy(1,1);
cout<<"+";
gotoxy(80,1);
cout<<"+";
gotoxy(1,49);
cout<<"+";
gotoxy(80,49);
cout<<"+";
for(i=2;i<80;i++)
{
gotoxy(1,4);
cout<<"+";
gotoxy(i,4);
cout<<"-";
}
cout<<"+";
gotoxy(30,3);
cout<<" COMPUTER";
gotoxy(78,2);
cout<<"X";
gotoxy(5,10);
cout<<"Game";
gotoxy(5,11);
cout<<"~";
gotoxy(5,14);
cout<<"Effects";
gotoxy(5,15);
cout<<"~";
switch(c=getch())
{
case 'X':
case 'x':
src=1;break;
case 'g':
case 'G':
clrscr();
game();
src=1;
return src;
case 'e':
case 'E':
clrscr();
efx();
src=1;
return src;
default:
goto back;
}
cout<<c;
clrscr();
return -1;
}
void film() //TO EXECUTE THE START OF THE PROGRAM
{
clrscr();
cout<<"\t\t\t";
textcolor (BLUE);
cprintf("MXP");
textcolor(BLUE);
cprintf(" MXP OPERATING SYSTEM");
textcolor(BLUE);
cprintf(" MXP Master Software inc,");
textcolor(BLUE);
cout<<"\n\nPlease wait while loading....";
cout<<"\n\nThis might take a few seconds please wait......";
delay(2000);
cout<<"\n\nDetecting processor...";
delay(200);
cout<<"\n\nDetecting RAM..";
delay(150);
cout<<"\n\nDetecting boot memory....";
delay(200);
cout<<"\n\nInstalling boot strap loader..";
delay(150);
cout<<"\n\nChecking CMOS memory..";
delay(200);
cout<<"\n\nVerifying hard disk space....";
delay(400);
cout<<"\n\nChecking for installed components..";
delay(100);
cout<<"\n\nLoading DLL files into software...";
delay(200);
cout<<"\n\nLoading Shell32.Dll..";
delay(100);
cout<<"\n\nERROR FOUND.... UNABLE TO LOAD SHELL32.DLL";
delay(30);
cout<<"\n\nLoading Shell.Dll..";
delay(100);
cout<<"\n\nERROR FOUND.... UNABLE TO LOAD SHELL.DLL";
delay(30);
cout<<"\n\nLoading Commdlg32.Dll..";
delay(100);
cout<<"\n\nLoading Commcat32.Dll..";
delay(100);
cout<<"\n\nLoading Commdlg.dll..";
delay(100);
cout<<"\n\nLoading Commcat.dll..";
delay(100);
cout<<"\n\nLoading backup files....";
delay(300);
cout<<"\n\nLoading Main.bak..";
delay(200);
cout<<"\n\nLoading Mycomp.bak..";
delay(200);
cout<<"\n\nLoading Cntrpnl.bak..";
delay(200);
cout<<"\n\nLoading Enter.bak..";
delay(200);
cout<<"\n\nLoading Entry.bak..";
delay(200);
cout<<"\n\nLoading Shut.bak...";
delay(100);
cout<<"\n\nLoading Shutdown.bak..";
delay(100);
cout<<"\n\nLoading Open.bak..";
delay(50);
cout<<"\n\nLoading Gess.bak..";
delay(100);
cout<<"\n\nLoading MAIN.EXE....";
delay(200);
cout<<"\n\nCorrupt files found!";
delay(100);
cout<<"\n\nSetting video mode..";
delay(100);
cout<<"\n\nSetting active display page.....";
delay(50);
cout<<"\n\nGetting current video mode..";
delay(20);
cout<<"\n\nGetting memory size....";
delay(100);
cout<<"\n\nReseting disk controller....";
delay(100);
cout<<"\n\nGetting disk status..";
delay(10);
cout<<"\n\nSeeking to cylinder......";
delay(300);
cout<<"\n\nController diagnostics..";
delay(100);
{
}
delay(300);
cout<<"\n\nGetting disk types..";
delay(20);
cout<<"\n\nGetting extended memory size.......";
delay(750);
cout<<"\n\nGetting time from CMOS..";
delay(50);
cout<<"\n\nGetting date from CMOS..";
delay(50);
cout<<"\n\nRecalliberating drives...";
delay(350);
cout<<"\n\nPLEASE WAIT WHILE THE SOFTWARE LOADS..........";
cout<<"\n\n\n\n\n\n\n\n\n\n";
for(int i=0;i<80;i++)
{
textcolor(YELLOW);
gotoxy(25,40);
cprintf(" OPERATING SYSTEM LOADING");
gotoxy(i+1,43);
textcolor(GREEN);
cprintf(">");
gotoxy(30,45);
cout<<i<<"%";
if(i%2==0)
delay(100);
else
delay(250);
}
textcolor(WHITE);
}
void login() //TO EXECUTE THE LOGIN PART IN THE PROGRAM
{
fstream f1("USERFILE.DAT",ios::in|ios::app);
lb:
clrscr();
int flag=0;
cout<<"\t\t\t";
textcolor(BLUE);
cprintf( " MXP");
textcolor(BLUE);
cprintf(" MXP OPERATING SYSTEM");
textcolor(BLUE);
cprintf(" MXP MASTER SOFTWARE");
textcolor(BLUE);
char nam[20],pass[10];
strcpy(nam,'\0');
strcpy(pass,'\0');
gotoxy(1,10);
cout<<"Login Name\t\t\t\t(Default if new & not case sensitive)";
gotoxy(1,11);
cout<<"Password\t\t\t\t\t(Case sensitive)";
gotoxy(20,10);
gets(nam);
gotoxy(20,11);
gets(pass);
if(strcmpi(nam,"default")==0||strcmpi(nam,'\0')==0)
goto g;
while(f1)
{
f1.read((char *) &L,sizeof(L));
if(strcmpi(nam,L.uname)==0)
{
if(strcmp(pass,L.password)==0)
{
flag=1;
break;
}
}
else
flag=0;
}
f1.close();
if(flag)
{
g:
gotoxy(35,30);
textcolor(BLUE);
cprintf("\nWelcome TO MXP OPERATING SYSTEM");
delay(2000);
}
else
{
cout<<"\nSorry wrong login name or wrong password";
cout<<"\n\nPlease re-enter";
getch();
clrscr();
goto lb;
}
textcolor(WHITE);
}
shut() //TO EXECUTE THE START MENU
{
top:
char ch;
gotoxy(1,34);
cout<<"+------------------+";
gotoxy(1,35);
cout<<"| NOTEPAD |";
cout<<"\n ~";
gotoxy(1,37);
cout<<"| MY DOCUMENTS |";
cout<<"\n ~";
gotoxy(1,39);
cout<<"| RESTART |";
cout<<"\n ~";
gotoxy(1,41);
cout<<"| LOG OFF |";
cout<<"\n ~";
gotoxy(1,43);
cout<<"| SHUTDOWN |";
cout<<"\n ~";
gotoxy(1,45);
cout<<"+------------------+";
gotoxy(1,60);
fflush(stdin);
ch=getch();
if(ch=='n'||ch=='N')
{
note();
src=1;
return src;
}
else if(ch=='s'||ch=='S')
shutdown();
else if(ch=='b'||ch=='B')
{
src=1;
return src;
}
else if(ch=='l'||ch=='L')
{
clrscr();
return src=20;
}
else if(ch=='r'||ch=='R')
{
clrscr();
gotoxy(20,20);
cout<<"\nMXP OPPERATING SYSTEM IS NOW RESTARTING.....";
delay(2000);
src=30;
return src;
}
else if(ch=='m'||ch=='M')
{
char re;
int place=0;
fstream filesread("FILES.DAT",ios::in|ios::ate);
filesread.seekg(0);
while(!filesread.eof())
{
filesread.read((char*)&Files,sizeof(Files));
if(filesread)
{
gotoxy(30,32+place);
place=place+1;
cout<<Files.filn;
}
}
filesread.seekg(ios::end);
int posi=filesread.tellp();
if(posi==0)
{
gotoxy(30,32);
textcolor(LIGHTGRAY);
cout<<"<none>";
textcolor(WHITE);
}
gotoxy(30,29);
cout<<"BACK";
gotoxy(30,30);
cout<<"~";
filesread.close();
re=getch();
if(re=='b'||re=='B')
{
for(int ref=0;ref<18;ref++)
{
gotoxy(20,29+ref);
cout<<" ";
}
goto top;
}
else
{
src=1;
return src;
}
}
else
return 1;
return -1;
}
void cntrl() //TO EXECUTE THE CONTROL PANNEL
{
back:
clrscr();
strcpy(dname,'\0');
strcpy(passw,'\0');
g=0;
for(int i=2;i<80;i++)
{
gotoxy(i,1);
cout<<"-";
gotoxy(i,49);
cout<<"-";
}
for(int j=2;j<50;j++)
{
gotoxy(1,j);
cout<<"|";
gotoxy(80,j);
cout<<"|";
}
gotoxy(1,1);
cout<<"+";
gotoxy(80,1);
cout<<"+";
gotoxy(1,49);
cout<<"+";
gotoxy(80,49);
cout<<"+";
for(i=2;i<80;i++)
{
gotoxy(1,3);
cout<<"+";
gotoxy(i,3);
cout<<"-";
}
cout<<"+";
gotoxy(10,2);
cout<<" CONTROL PANNEL";
gotoxy(78,2);
cout<<"X";
gotoxy(10,6);
cout<<"\n\n| 'U' to create a new user";
cout<<"\n\n| 'D' to delete an existing user";
cout<<"\n\n| 'M' to modify an existing user";
switch(ce=getch())
{
case 'x':
case 'X':{src=1;break;}
case 'U':
case 'u':
{
int q;
fstream f2("USERFILE.DAT",ios::app|ios::ate);
up:
clrscr();
cout<<"\nEnter the details\t\t";
cout<<"\n\nThe name should contain a maximum of 15 charectors";
cout<<"\n\n\nNAME\t\t\t";
gets(L.uname);
cout<<"\nPASSWORD\t\t";
gets(L.password);
f2.write((char *)&L,sizeof(L));
cout<<"\n\nRecord copied";
f2.close();
getch();
src=1;
}
break;
case 'd':
case 'D':
{
fstream f3("USERFILE.DAT",ios::in|ios::ate);
fstream f("TEMP.DAT",ios::out|ios::ate);
clrscr();
char cn;
int flag=1;
strcpy(dname,'\0');
cout<<"\nEnter the user name to be deleted (max 10)\t";
gets(dname);
f3.seekg(0);
while(f3)
{
f3.read((char *)&L1,sizeof(L1));
if(strcmpi(L1.uname,dname)!=0)
{
f.write((char *)&L,sizeof(L));
flag=0;
}
else
{
flag=1;
break;
}
}
if(flag==0)
{
cout<<"\n\nUSER NOT FOUND";
getch();
goto back;
}
f3.close();
f.close();
flush(f);
flush(f3);
remove("USERFILE.DAT");
rename("TEMP.DAT","USERFILE.DAT");
cout<<"\nDeleted";
cout<<"\n\nPress any key to continue";
getch();
src=1;
}
break;
case 'm':
case 'M':
{
fstream f4("USERFILE.DAT",ios::in|ios::out);
int flag1=0;
clrscr();
char name1[20],name2[20];
cout<<"\nEnter the user name to be modified\t";
gets(name1);
int n;
f4.seekg(0);
while(f4)
{
f4.read((char *) &L,sizeof(L));
if(strcmpi(name1,L.uname)==0)
{
cout<<"\n\nEnter a new name\t\t\t";
gets(name2);
strcpy(L.uname,name2);
n=f4.tellg()-sizeof(L);
f4.seekp(n);
f4.write((char *) &L,sizeof(L));
cout<<"\nModification done";
cout<<"\n\nPress any key to continue";
getch();
goto ref;
}
else
flag1=0;
}
if(!flag1)
{
cout<<"\n\nUser not found";
cout<<"\n\nPress any key to continue";
getch();
goto back;
}
ref:
f4.close();
src=1;
}
break;
default:
goto back;
}
cout<<ce;
clrscr();
src=1;
}
int enter() //TO EXECUTE THE MAIN SCREEN OF THE PROGRAM
{
char ch;
int init=0;
main:
do
{
ifstream the2("THEME.DAT");
while(the2)
{
the2.read((char*)&TH,sizeof(TH));
}
the2.close();
clrscr();
setncolor();
gotoxy(1,5);
cout<<"&&&";
cout<<"\n&&&\tMY COMPUTER";
cout<<"\n&&&\t~";
cout<<"\n\n\n";
cout<<"&&&";
cout<<"\n&&&\tCONTROLS";
cout<<"\n&&&\t~";
gotoxy(1,49);
textcolor(TH.sl);
cprintf("+------------------------------------------------------------------------------+");
gotoxy(1,50);
cprintf("| ");textcolor(TH.s);cprintf("MENU");textcolor(TH.sl);cprintf("|");
textcolor(TH.sf);
cprintf(" (H)elp");
textcolor(TH.sl);
cprintf(" () |");
gotoxy(1,49);
cprintf("\n+------------------------------------------------------------------------------+");
gotoxy(1,5);
textcolor(WHITE);
ch=getch();
int val;
if(ch=='d'||ch=='D')
{
gotoxy(47,48);textcolor(TH.d);cprintf(" Date:");
struct date D;
getdate(&D);
gotoxy(55,48);
cout<<(int)D.da_day<<"/"<<(int)D.da_mon<<"/"<<(int)D.da_year;
gotoxy(67,48);textcolor(TH.t);cprintf("Time:");
struct time T;
gettime(&T);
gotoxy(73,48);
cout<<(int)T.ti_hour<<":"<<(int)T.ti_min<<":"<<(int)T.ti_sec;
textcolor(TH.sl);
delay(2500);
textcolor(WHITE);
goto main;
}
else if(ch=='m'||ch=='M')
{
clrscr();
MYCOMP();
goto main;
}
else if(ch=='s'||ch=='S')
{
val=shut();
if(val==1)
goto main;
else if(val==20)
{
return src=20;
}
else if(val==30)
{
return src=30;
}
}
else if(ch=='c'||ch=='C')
{
cntrl();
goto main;
}
else if(ch=='\\')
{
char ti=' ';
int r,c;
randomize();
r=rand()%40;
c=rand()%40;
if(r==0||c==0)
r=c=5;
gotoxy(r,c-1);
cout<<"+---------------------+";
gotoxy(r,c);
cout<<"|1.Change logo colour |";
gotoxy(r,c+1);
cout<<"|2.Change theme |";
gotoxy(r,c+2);
cout<<"|0.BACK |";
gotoxy(r,c+3);
cout<<"+---------------------+";
ti=getch();
if(ti=='0')
goto main;
else if(ti=='1')
props();
else if(ti=='2')
settheme();
else
goto main;
goto main;
}
else if(ch=='h'||ch=='H')
{
help();
goto main;
}
else
{
clrscr();
goto main;
}
}while(init>0);
return 0;
}
void main() //MAIN
{
clrscr();
textcolor(RED);
for(int i=80;i>25;i--)
{
gotoxy(i,25);
cprintf(" OPERATING SYSTEM");
clreol();
gotoxy(1,26);
clreol();
delay(50);
}
delay(1000);
textcolor(GREEN);
for(i=25;i>0;i--)
{
gotoxy(i,25);
cprintf(" OPERATING SYSTEM");
clreol();
delay(25);
}
clrscr();
do
{
textcolor(WHITE);
if(src==30)
{
film();
login();
}
else
login();
enter();
}while(src<=30);
}