The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: hotrod on February 07, 2010, 11:20:25 AM

Title: Windows 7 + screen resolution
Post by: hotrod on February 07, 2010, 11:20:25 AM
I purchased a new laptop with a 1920 x 1080 resolution after building this http://www.masm32.com/board/index.php?topic=13195.0 on a 1200 x 800. The dialog and controls look fine on the new display, but the portion at the bottom where all the work is being done has shrank as I would expect leaving it distorted. Why would part of it change and the rest not? Thanks...
Title: Re: Windows 7 + screen resolution
Post by: MichaelW on February 07, 2010, 03:22:27 PM
One problem I see in your code is that it contains hard-coded coordinate values in screen units (pixels) for the MoveToEx and LineTo functions, and to initialize a RECT structure. Such values are not generally compatible with a dialog. Coordinates and width and height values in a dialog are specified in dialog template units. Dialog template units are based on the average width and height of the font used, allowing the dialog box to have essentially the same on-screen proportions and appearance (but not the same apparent size) across different resolutions and/or aspect ratios. One way around this problem is to derive any pixel units you need from dialog template units. See  MapDialogRect (http://msdn2.microsoft.com/en-us/library/ms645502.aspx).
Title: Re: Windows 7 + screen resolution
Post by: hotrod on February 07, 2010, 05:18:14 PM
I see what you mean, off to the research department. Thanks MichealW. I need one of those speech enabled machines that can write code with all the schooling I am going to.