Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sysmetric() different in VFP 6
Message
From
15/11/2000 20:09:14
Karl Scheff
California Department of Education
Sacramento, California, United States
 
 
To
09/02/2000 12:29:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00329485
Message ID:
00442419
Views:
18
>>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
Map
View

Click here to load this message in the networking platform