Calader Sorce Code

Submitted by: Submitted by

Views: 140

Words: 396

Pages: 2

Category: Other Topics

Date Submitted: 12/18/2012 09:15 AM

Report This Essay

#include

#include

#include

/**********************************************

Project: Calender Application

Language : C

@Author : CodingTalks

Project Type : Mini Project , 12th class Project

***********************************************/

struct Date{

int dd;

int mm;

int yy;

};

struct Date date;

struct Remainder{

int dd;

int mm;

char note[50];

};

struct Remainder R;

COORD xy = {0, 0};

void gotoxy (int x, int y)

{

xy.X = x; xy.Y = y; // X and Y coordinates

SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), xy);

}

//This will set the forground color for printing in a console window.

void SetColor(int ForgC)

{

WORD wColor;

//We will need this handle to get the current background attribute

HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);

CONSOLE_SCREEN_BUFFER_INFO csbi;

//We use csbi for the wAttributes word.

if(GetConsoleScreenBufferInfo(hStdOut, &csbi))

{

//Mask out all but the background attribute, and add in the forgournd color

wColor = (csbi.wAttributes & 0xF0) + (ForgC & 0x0F);

SetConsoleTextAttribute(hStdOut, wColor);

}

return;

}

void ClearColor(){

SetColor(15);

}

void ClearConsoleToColors(int ForgC, int BackC)

{

WORD wColor = ((BackC & 0x0F) 2000)

res = res + 1;

res = res % 7;

return res;

}

char *getDay(int dd,int mm,int yy){

int day;

if(!(mm>=1 && mm=1 && dd=1600){

day = getDayNumber(dd,mm,yy);

day = day%7;

return(getName(day));

}else{

return("Please give year more than 1600");

}

}

int checkNote(int dd, int mm){

FILE *fp;

fp = fopen("note.dat","rb");

if(fp == NULL){

printf("Error in Opening the file");

}

while(fread(&R,sizeof(R),1,fp) == 1){

if(R.dd == dd && R.mm == mm){

fclose(fp);

return 1;

}...