Category : Utilities for DOS and Windows Machines
Archive   : SETEXEC.ZIP
Filename : VIDTYPE.C

Output of file : VIDTYPE.C contained in archive : SETEXEC.ZIP
VIDTYPE.C -- detects video card type (and monitor type, but only for
informational purposes), and sets an errrorlevel based on the video card
type detected. Use in a DOS Batch file to load a specific driver, perhaps
on a LAN with mixed video configs.

This implementation was written using Quick C 2.5. Compile it however
you want, but don't forget to include the graphics.lib in your link command
sample compile and link:
qcl /c /Ox vidtype.c
qlink vidtype,,,graphics.lib


#include /* must be included. Structure references */
/* come from this header file. */

int el; /* integer variable to hold errorlevel value */


struct videoconfig text; /* define structure: videoconfig */
short adapter; /* then declare structure: text */
short monitor; /* other two 'shorts' are structure */
/* members used in the program. */
/* see GRAPHICS.H */

_getvideoconfig ( &text ); /* get text and general video information */

switch (text.monitor) /* since the monitor type is less */
{ /* important re a software driver */
/* we only display this information */

case 0x0001:
printf ("\nFYI: monitor type ==> DIGITAL MONO");

case 0x0002:
printf ("\nFYI: monitor type ==> DIGITAL COLOR");

case 0x0004:
printf ("\nFYI: monitor type ==> DIGITAL ENHANCED COLOR");

case 0x0008:
printf ("\nFYI: monitor type ==> ANALOG MONO");

case 0x0010:
printf ("\nFYI: monitor type ==> ANALOG COLOR");

case 0x0018:
printf ("\nFYI: monitor type ==> ANALOG");

default :
printf ("\nFYI: monitor type ==> Other (worldly)");


switch ( text.adapter ) /* the video card type is key, so */
{ /* this information is used to set */
/* the DOS errorlevel, sensed by the */
/* batch file. */
case _MDPA:
printf ("\nADAPTER TYPE ==> 01: Monochrome Display Adapter (MDPA)\n");
printf ("Errorlevel set to ==> 1\n");
el = 1; /* el gets set accordingly, within each */
break; /* each case statement */

case _CGA:
printf ("\nADAPTER TYPE ==> 02: Color Graphics Adapter (CGA)\n");
printf ("Errorlevel set to ==> 2\n");
el = 2;

case _EGA:
printf ("\nADAPTER TYPE ==> 04: Enhanced Graphics Adapter (EGA)\n");
printf ("Errorlevel set to ==> 4\n");
el = 4;

case _VGA:
printf ("\nADAPTER TYPE ==> 08: Video Graphics Array (VGA)\n");
printf ("Errorlevel set to ==> 8\n");
el = 8;

case _MCGA:
printf ("\nADAPTER TYPE ==> 10: MultiColor Graphics Array (MCGA)\n");
printf ("Errorlevel set to ==> 9\n");
el = 10;

case _HGC:
printf ("\nADAPTER TYPE ==> 20: Hercules Graphics Card (HGC)\n");
printf ("Errorlevel set to ==> 20\n");
el = 20;

printf ("\nSorry ==> Video Adpater Unknown! (VAU) \n");
printf ("Errorlevel set to ==> 0\n");
el = 0;

printf("\n Dan Goldberg, late July, 1991. \n");

  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : SETEXEC.ZIP
Filename : VIDTYPE.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: