Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Screens...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00225581
Message ID:
00225939
Vues:
14
>>>>>Does anyone know how I can go about automatically having my apps check the size of the user's monitor and adjust accordingly?
>>>>
>>>>There's no way to tell the size of the monitor - the screen resolution is easy (between SYSMETRIC() and code in the FAQ for retrieving color depth, it's no problem) but there's no real way to dtermine if the output is going to a 2" LCD or a 5' projection screen...
>>>
>>>Hi Ed,
>>>
>>>I don't know if this is an answer or a question.< g > GetDeviceCaps() has a HORZSIZE and VERTSIZE parameter options. According to the SDK, they return the horizontal and vertical size of the physical screen in millimeters. However, on my 17" monitor, they return 169 and 127 millimeters respectively, or in other words, about half the actual physical size of the monitor. Comments?
>>
>>I get the same values returned from HORSIZE and VERTSIZE regardless. there's an interesting quote in Daniel Appleman's Visual Basic Programmer's Guide to the Win32 APIin Chapter 7, under Scaling and Coordinates Logical versus Device Coordinates:
>>
>>The accuracy of the output will vary by device. A device such as a printer, which has an exact physical resolution expressed as the numer of dots per inch, can produce extrememly accurate output. if the program draws a line that is one inch long in the logical coordinate system, it will appear exactly one in long on paper.
>>
>>Display monitors do not have the same precision. A 640x480 pixel display will appear differently on a 13-inch monitor than it does on a 21-inch monitor. Windows does not know the size of the monitor you are using, so it defines a logical inch for displays that are usually close to a physical inch. the determination of how many display pixels are in a logical inch is made by the device driver, and can be determined using the GetDeviceCaps DC information function.

>>
>>IOW, GetDeviceCaps returns logical, not physical inches for the screen. Appleman describes the concept of logical inches and screen coordinates in some detail in Chapter 7. It's a great read, and it's one of the (IMO) essential Win32 API references to have around; right up there in my book with the MSDN itself and Richard Simon's Windows NT Win32 API SuperBible as far as essential API references. If I didn't program in C and had to pick a single API book to work from, Appleman would be my first choice.
>
>Got the hiccups, Ed?< bg >
>

Couldn't get the #$@^(*^& HTML codes right...besides, a little repetition on this topic isn't all that bad!

>Anyway, thanks for the information and heads up. The SDK is rather unclear as to whether or not they're referring to the actual or the logical physical size.

No problem; the only other really good discussion of the concept of logical vs physical scaling is in The Windows 98 Developer's Guide, and overall, it isn't as readable a reference for VFP people.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform