Category : Files from Magazines
Archive   : VOL10N13.ZIP
Filename : GETMAXX.C
#include
#include
#include
#include
#define MAXDRIVERS 3
int graphdrivers[MAXDRIVERS] = { CGA, EGA, VGA };
char *graphdrivernames[MAXDRIVERS] = { "CGA", "EGA", "VGA" };
void main(void)
{
int graphmode = 0, i, j, low, high, err;
int midx, midy, texth;
char xrange[80], yrange[80], drivername[80];
for(i = 0; i < MAXDRIVERS; i++)
{
initgraph(&graphdrivers[i], &graphmode, "");
if(err = graphresult())
{
printf("Graphics error: %s\n",grapherrormsg(err));
printf("Press any key to exit program...");
getch();
restorecrtmode();
exit(1);
}
getmoderange(graphdrivers[i],&low,&high);
for( j = 0; j < 2; low = high, j++)
{
setgraphmode(low);
midx = getmaxx() / 2;
midy = getmaxy() / 2;
sprintf(drivername,"%s, mode:%s number:%d",
graphdrivernames[i],
getmodename(getgraphmode()),
getgraphmode());
sprintf(xrange,"X values range from 0 to %d",getmaxx());
sprintf(yrange,"Y values range from 0 to %d",getmaxy());
settextjustify(CENTER_TEXT,CENTER_TEXT);
texth = textheight("W");
outtextxy(midx,midy,drivername);
outtextxy(midx,(midy += texth),xrange);
outtextxy(midx,(midy += texth),yrange);
getch();
}
closegraph();
}
exit(0);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/