detectgraph,计算机函数。实现检测硬件确定图形驱动程序和模式。
detectgraph,计算机函数。实现检测硬件确定图形驱动程序和模式。
函数名: detectgraph
用 法: void far detectgraph(int far *graphdriver, int far *graphmode);
程序例:
#include <graphics.h>
#include
#include
#include
char *dname = { "requests detection",
"a CGA",
"an MCGA",
"an EGA",
"a 64K EGA",
"a monochrome EGA",
"an IBM 8514",
"a Hercules monochrome",
"an AT&T 6300 PC",
"a VGA",
"an IBM 3270 PC"
};
int main(void)
{
int gdriver, gmode, errorcode;
detectgraph(&gdriver, &gmode);
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %sn",
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
clrscr();
printf("You have %s video display
card.n", dname);
printf("Press any key to halt:");
getch();
return 0;
}