Subject: Re: how does Windows know the physical dimensions of my monit 
Distribution: world
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Date: Thu, 7 Jan 1993 19:26:47 +0000

In article <1993Jan7.001644.7600@emr1.emr.ca> jagrant@emr1.emr.ca writes:

>The docs say that the following:
>        xsize=GetDeviceCaps(hdc,HORZSIZE);
>        ysize=GetDeviceCaps(hdc,VERTSIZE);
>returns the dimensions of the physical display (mm).
>How does it know these values for monitors????
>
>First of all, who am I talking to when I call GetDeviceCaps?
>The display driver?  Windows?
>

You're talking to Windows.  Windows then asks the display driver.

>If I am talking to the display driver, does it return these values by:
>    1. looking them up from a table in the driver
>    2. asking the graphics card for the values
>    3. computing them from the resolution of the card and the
>       size of a single pixel.  If so, does it get the size of
>       the pixel from:
>          (a) a table in the driver
>          (b) asking the graphics card for the values
>

It gets the values from the device driver.  The device driver can get
them by any method it chooses, although I've NEVER heard of a driver which
asks the graphics card :)  The standard method is to assume a standard
monitor size, and base the results on that.  Typically the assumption is
that a 14" monitor is in use at 640x480, a 17" at 1024x768, and a 20" at
1280x1024.

>I have a VGA Wonder and a NEC 3D.  When I use ATI's VSETUP program, I
>can tell it that I have a NEC 3D.  Presumably VSETUP has a table of monitor
>dimensions and sets that in the card's config table.  The Windows driver
>can then ask the *card* how big the monitor is.  But what if I hook up
>another monitor that VSETUP doesn't know about?  What then?
>

No - the reason the ATI setup program asks you about the monitor is so it
knows the maximum scan rates the monitor will support - it's nothing to
do with the physical *size* of the monitor.

>The size is returned correctly on my system, but
>the values returned on a NEC 6G (*huge beast*) are incorrect (smaller
>than they should be).  That system is running a #9 24-bit card
>in 1280 X 1024 resolution.  When it was set up, there was no way to
>tell the card which monitor was being used.
>
>I would appreciate it if somone who knows driver internals could
>poke around in the DDK for an answer.
>
>-- 
>John A. Grant                                           jagrant@emr1.emr.ca
>Airborne Geophysics
>Geological Survey of Canada, Ottawa
>

As you'll have noticed, values returned for printers are exact.  If you have
a program which requires exact sizes on the screen, you'll probably have
to resort to have the values entered by the user.  After all, you can
change the monitor image size quite drastically using the monitor's
controls, normally, so the question of the "correct" size is meaningless.
-- 
--------------------------------------------------------------------------
| Chris Marriott                           | chris@chrism.demon.co.uk    |
| Warrington, UK                           | BIX: cmarriott              |
| (Still awaiting inspiration              | CIX: cmarriott              |
|  for a witty .sig .... )                 | CompuServe: 100113,1140     |
--------------------------------------------------------------------------