General information
Category:
Coding, syntax & commands
>>It appears to me that SYSMETRIC(1) and SYSMETRIC(2) do not work exactly the same way in VFP 6.0 as they do in VFP 5.0. When I change the screen resolution WITHOUT LEAVING VFP, VFP 5.0 correctly changes the return value of sysmetric(1) while VFP 6.0 returns the screen resolution that was active when I first opened VFP 6.0. In other words SYSMETRIC(1) is not correctly updated in VFP 6.0 if you change the screen resolution without first leaving VFP.
>>
>>I like to change the resolution to check out if my resizable forms are working correctly, but now in VFP 6.0, I actually have to leave VFP 6.0 and restart it to get the SYSMETRIC function to return the correct values.
>>
>>Has anyone else experienced this or is this peculiar to my hardware setup? Or is there a workaround?
>>
>>Thanks in advance,
>>Karl Scheff
>
>In the bad old days, changing screen resolution meant restarting your computer. Some clever video driver authors devised ways to do it on the fly. However, unless you've turned the warning off, you are warned that Windows apps may not work correctly if you do this.
>
>I imagine this is what you're running into. It looks like VFP6 uses a slightly different method to calculate its SYSMETRIC() functions, but that's a moot point.
Answer is:
DECLARE INTEGER GetSystemMetrics IN Win32API INTEGER liParam
nHoriz = getSystemMetrics(16)
nVertical = GetSystemMetrics(1)
Karl
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only