Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change resolution
Message
From
09/09/2017 00:28:12
 
 
To
08/09/2017 14:36:53
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01654134
Message ID:
01654158
Views:
119
This message has been marked as the solution to the initial question of the thread.
>my new HP has by default 125% fontsize which is OK and fine, since 100% is soooo small, hardly to read. Now when I start FoxyPreviewer all fonts are on a 125% scale and what is even worse, reports are badly printed, they dont fit on the page (This seems to be a known bug) Easy to solve, change back to 100% and reports turn out correct.
>So I figured to change to font to 100 % beforre printing and change it back to 125% after printing.

Hi Koen.
This sounds like a problem someone had that I read about some time ago. They fixed it by setting their VFP app to be DPI aware.
I haven't tried it myself, but here is the quick note I made for myself if case I needed to look into it in the future.
If you try it let me know how it goes.

Ian Simcock.


If someone has font scaling set to a non 100% value then the VFP report viewer will draw the reports scaled and they won't fit properly.
There are a number of ways around this -
1) Check "Disable display scaling on high DPI settings" in exe shortcut properties on Compatibility page

2) Add the follwing API call in your app as early as possible (before opening any forms or other displays) -
Try
   DECLARE INTEGER SetProcessDPIAware in WIN32API
   SetProcessDPIAware()
EndTry
3) Use a Manifest file when bulding the exe to declare that the app if DPI Aware.
If you copy the following XML into the project folder and name it "<Your Exe>.exe.manifest" when you build your exe it will be automatically included.
More information about what can be in a manifest file can be found at https://msdn.microsoft.com/en-us/library/windows/desktop/aa374191%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Rick Strahl has an article about manifest files at https://west-wind.com/wconnect/weblog/ShowEntry.blog?id=890
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0" type="win32" name="Microsoft.VisualFoxPro" processorArchitecture="x86" />
    <description>Visual FoxPro 9 application</description>
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel level="asInvoker" />
            </requestedPrivileges>
        </security>
    </trustInfo>
    <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <windowsSettings>
            <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True</dpiAware>
        </windowsSettings>
    </application>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" />
        </dependentAssembly>
    </dependency>

	<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
        <application> 
            <!-- Windows 10 --> 
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
            <!-- Windows 8.1 -->
            <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
            <!-- Windows Vista -->
            <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> 
            <!-- Windows 7 -->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
            <!-- Windows 8 -->
            <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
        </application> 
    </compatibility>

</assembly>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform