Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Screens...
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00225581
Message ID:
00225931
Views:
13
>>>>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 >

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.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform