GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-Jul-2012, 17:01
andrewjrmill andrewjrmill is offline
New Member
 
Join Date: Apr 2012
Posts: 1
andrewjrmill is on a distinguished road
Question

I want to update my operating system with mouse and new win


I want to update my operating system with mouse and new icons and how to add more programs because all it is now is by pressing latters to open up stuff, i have this operating system that i made and i want to put icons on the desktop and i was wandering if anyone can tell me how to program open new software and be able to save it to desktop, this is just a test project im just learning how to make an operating system gui. here is my code, and what do you suggest on how to make this better i would like everyone answer. thanks everyone.
CPP / C++ / C Code:
//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=='q'||th=='Q')
		{
			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=='q'||th=='Q')
		{
			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=='q'||th=='Q')
		{
			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=='q'||th=='Q')
		{
			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=='q'||th=='Q')
		{
			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("START");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);
}



So i should not worry about the gui right now, i just want to make it better that way i know what i want my operating system to look like, and right now it just a shell gui for DOS so it loads through DOS i have a kernel made and a boot loader that i have programmed, i just want to get it looking better thats all thanks for your post guys, i am open for any suggestions.
Attached Files
File Type: zip operating system.zip (59.3 KB, 2 views)
  #2  
Old 08-Jul-2012, 09:05
Mexican Bob's Avatar
Mexican Bob Mexican Bob is offline
Regular Member
 
Join Date: Mar 2008
Location: Chicxulub, Yucatán
Posts: 656
Mexican Bob is just really niceMexican Bob is just really niceMexican Bob is just really niceMexican Bob is just really nice

Re: I want to update my operating system with mouse and new win


Quote:
Originally Posted by andrewjrmill
So i should not worry about the gui right now, i just want to make it better that way i know what i want my operating system to look like, and right now it just a shell gui for DOS so it loads through DOS i have a kernel made and a boot loader that i have programmed, i just want to get it looking better thats all thanks for your post guys, i am open for any suggestions.

I'm not sure that I'd call this an "operating system" or even a "kernel" of any sort. Whatever it is that you "really" want to do with it, it isn't ready for it by any classical definition of an operating system. First, it sits atop of "DOS" and doesn't provide any operating system features with the possible ambiguous exception of "running" a "user program" like "notepad."

The code is horribly intertwined with console IO. There are no real operating system features being exposed by your code. At best, it is a "menu driven application." Operating systems provide an application execution environment and realize the necessary abstractions between the hardware/devices and the application(s). At a minimum, one would expect some notion of tasks or processes and your code does neither; at least as far as I can tell with a quick glance at it.

If you truly want to make your own "operating system," which is perfectly fine, you will want to consider some kind of layered approach that separates functional layers rather than intertwines them together.

Any "real" programmer wouldn't be able to "add" anything to your "system" because it is incredibly disjointed and there really isn't any "place" to begin working on because there are no real "layers" only a seemingly random collection of "do somethings" that are not API-driven in any classical sense.

Does "while(f)" actually do what you expect? I've never seen any "operating system" ever do anything remotely similar to what you're doing or how you're doing it.

Hopefully this won't sound mean spirited or otherwise insulting; it isn't meant to be. Have you ever read a book on operating system(s) or design/architecture of any operating system...ever? That might be a "good place" to start if you really want an "operating system."

Furthermore, I'd probably avoid using "rar" to archive files when using the .zip file extension. At a minimum, it suggests to other users on the Internet to avoid your file(s) because it isn't what is says it is and may be a virus or other malicious entity. I didn't look at the contents of the rar file, so maybe there is something "useful" with respect to operating systems in it...though from the code above, I'd find that rather unlikely.

None of this should be taken as an attack or insult to you; rather, hopefully, it will serve as a "wake-up call" to better consider/define what it is you really want to accomplish and to have you "take a step back" to consider the "world" as a whole, particularly in terms of WHAT an operating system *usually* does/provides in relationship to the hardware and application(s) so that you may eventually work toward a similar goal--if you really want to call this code an OS.

Writing an OS is non-trivial. OSes provide services and, probably most importantly, a set of "system calls" that enable applications to make use of those services. The system calls tend to range from incredibly rudimentary to relatively encompassing depending on the complexity of the OS and the features that it provides. Some very simple OSes do relatively little. Complex OSes like Windows, DOS, Linux, Mac OSX and numerous others do relatively A LOT.

Whatever it is you're thinking about in terms of "GUI" or other "UI," maybe that's what you'd really like to do and are simply using the wrong terminology? Whenever someone #include's conio.h and dos.h, real programmers cringe. While it is likely an interesting pursuit in the world of obsolete operating systems, tools and user interfaces, it has very limited practicality except perhaps from gaining the lessons learned from those who "been there and done that" so many years ago. If you're seeing an opening in the job markets for DOS programmers, I'd say that you're as likely a candidate as anyone currently deploying for that market because both are nearly brain-dead in terms of being suited for any reasonable task. Possibly if you had a rather unlimited number of 20MHz i386-SX PC-104 boards; each with only 1 MB of RAM, one could almost present an argument in favor of considering DOS a viable alternative for whatever control software we would expect to find such a world. Most of us would find it incredibly difficult to justify the power expense compared to a $2 16 or 32-bit PIC or ARM micro.

Since it seems that you are truly a beginning programmer (and all of us had to start somewhere), I'd strongly recommend that you use an updated compiler. There are numerous free ones available. If you find yourself using DOS as the underlying operating system (the OS part of DOS actually stands for Operating System), and you want the graphical capabilities afford by Turbo C++, I suppose that you can invest your time in that space.

I'd suggest that you decouple your code using appropriately named and defined interfaces. I find it incredibly hard to believe that any "OS" would have a function named 'e' or 'w' and that either of those would be "useful abstractions of the hardware to the application execution environment."

I would also suggest that you stay completely away from the C++ language and move to the C world...and not because I'm a C bigot when it comes to OSes. I've written a couple of operating systems in C++, the last one in 1996 before the then emerging eC++ standard came out. I don't think that anyone has even updated that standard in at least a decade...and those architectures that do support a C++ compiler tend to feature more capability than even the standard attempted to realize.

If you find yourself desirous of using C++, then you should actually take a few moments away from your busy schedule to learn C++. What you've presented in code by way of this forum (without considering the archived content), is explicitly not C++ in any reasonable kind of way except in terms of "requiring" a horribly obsolete and now non-conforming compiler. None of the "attributes" of a "well-written" C++ "program" (much less operating system) exists in the code I've seen in this thread.

If you find this insulting, please consider that it is nearly equally insulting for others to present code as being C++ when it is hardly better than a complete novice approach to the language. That by itself is "not bad," but this isn't C++, it isn't an Operating System, it isn't a GUI and there is no fundamental purpose for a "mouse" or anything remotely approaching what you seem to seek excepting "update" is definitely required.

I'd suggest that you start with your tools. If you need to execute from a Windows-base platform, then use MinGW or Cygwin or any of several free versions of tools such as the Microsoft educational-used tools.

Befriend google and start searching for content on operating system fundamentals. Consider:

http://www.cise.ufl.edu/~chow/sl1.pdf/

See page 3 for a nifty figure of the relevant layers of an OS (Windows NT, in this case).

There are practically an unlimited number of areas that you can research in the field of operating systems. Just the topics of scheduling algorithms fill volumes; I know, I own probably a dozen or more titles on the subject and there are probably dozens more that I won't/haven't purchase(d).

Most of all, good luck to you; we're really here to help, but you need to give us something to work with. You seem like you're trying to apply a few lessons learned about "coding" rather than taking the necessary time to really understand why we code and how we do it so that it isn't really and ugly collection of crap that is barely garbage in and garbage out. If you find that insulting, hopefully it will motivate you to engage yourself in learning what is "good" about what I've presented here rather than simply become annoyed as it seems so many others do...I call it Inspiration Through Attrition. Weed out all but the most stubborn seeks of truth in computer science...or something similarly as noble an endeavor?


MxB
 
 

Recent GIDBlogConfiguring iptables for Webmin Servers Index Module by gidnetwork

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:07.


vBulletin, Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.