[comp.sys.ibm.pc] Determine current video adapter/monitor

tomj@hpccc.HP.COM (Tom Johnson) (11/01/89)

What is the best way to determine in a program what video adapter/monitor
is currently installed??  I'm specifically concerned with MONO/CGA/EGA/VGA
adapters.

Any information might be useful.

Tom Johnson
tomj@hpccc.hp.com
415-857-7396

crmeyer@voodoo.ucsb.edu (11/02/89)

In article <5060063@hpccc.HP.COM>, tomj@hpccc.HP.COM (Tom Johnson) writes...
> 
>What is the best way to determine in a program what video adapter/monitor
>is currently installed??

In most C compilers their are comands to query what graphics adapter is in use.
My manual on Mix C has the command 'getvconfig' that reurns a pointer to a
construct containing all sorts of info...(x&y resolution, aspect ratio, 
number of colors, etc). From this you should be able to figure out what
adapter is being used.

ts@chyde.uwasa.fi (Timo Salmi LASK) (11/04/89)

In article <5060063@hpccc.HP.COM> tomj@hpccc.HP.COM (Tom Johnson) writes:
>What is the best way to determine in a program what video adapter/monitor
>is currently installed??  I'm specifically concerned with MONO/CGA/EGA/VGA
>adapters.

I do not know what the best way is.  Nevertheless, you could try
grapinfo.exe in the /pc/ts/tsutil27.arc, available by anonymous ftp
from our site.  It detects the graphics hardware on a PC.  Also,
there was a source recently in DDJ or PC-Magazine for this.  That
used interrupts (and did not recognize all the standard
alternatives), mine uses the Turbo Pascal graphics abilities. 

...................................................................
Prof. Timo Salmi                                (Site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun

chasm@attctc.Dallas.TX.US (Charles Marslett) (11/07/89)

In article <2844@hub.UUCP>, crmeyer@voodoo.ucsb.edu writes:
> In article <5060063@hpccc.HP.COM>, tomj@hpccc.HP.COM (Tom Johnson) writes...
> > 
> >What is the best way to determine in a program what video adapter/monitor
> >is currently installed??
> 
> In most C compilers their are comands to query what graphics adapter is in use.
> My manual on Mix C has the command 'getvconfig' that reurns a pointer to a
> construct containing all sorts of info...(x&y resolution, aspect ratio, 
> number of colors, etc). From this you should be able to figure out what
> adapter is being used.

I don't know about Mix C, but both Turbo and Microsoft C have similar functions
that seem disgustingly unreliable, considering how simple the task is.  IBM
has a one page description in their BIOS technical reference manual that
covers an extremely easy, reliable decision tree to identify the card type,
it's extensible, and it's easy to debug.  Getting a table from a "magic"
subroutine and trying to make it work leads to your code running in the
least common resolution usually.  If there is any interest, I'll post a
description.

Charles
===============================================================================
"Those who would sacrifice **  Charles Marslett
liberty for security,      **  STB Systems, Inc. <-- apply all std. disclaimers
deserve neither."          **  Wordmark Systems  <-- that's just me
  -- Benjamin Franklin     **  chasm\@attctc.dallas.tx.us
-------------------------------------------------------------------------------

davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) (11/08/89)

Please post a description of how to identify video types. I have great
trouble telling the various superVGAs apart.

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

jamesd@qiclab.UUCP (James Deibele) (11/09/89)

In article <5060063@hpccc.HP.COM> tomj@hpccc.HP.COM (Tom Johnson) writes:
>
>What is the best way to determine in a program what video adapter/monitor
>is currently installed??  I'm specifically concerned with MONO/CGA/EGA/VGA
>adapters.

The current issue (Summer, 1989 or Volume 4, #1) of the C Gazette has source
code for identifying video adapters.  The code is available on our BBS in an
.ARC file with other source from the issue.

A plug for the C Gazette (not affiliated with them in any way except as a happy
customer): they bill themselves as "a code-intensive C quarterly for MS-DOS
systems" and that's exactly what they are.  They sell back issues at reasonable
(list) prices instead of 3 or 4 times what they originally cost.  Last I knew,
we were the only store to carry them, so you'd have to call (213) 473-7414 to
talk to Andrew about subscribing ($21/year).  I'd say it's worth it.

-- 
James Deibele  jamesd@qiclab  BBSs: (503) 760-1473 or (503) 761-7451
TECHBooks: The Computer Book Specialists  ---  Voice: (503) 646-8257
12600 SW 1st  Beaverton, OR  97005  --- Book reviewers wanted for
computer science & electronics - contact us for more information.