Page 1 of 1
Win32 embedded WPF form scaling issue in Windows 8+
Posted: Mon Feb 29, 2016 4:40 pm
by norbertjurkiewicz84
Has anyone figured out how to stop the host Win32 form from rescaling to 1x DPI when it starts a child WPF Window. I believe there is a <dpiAware> setting that can be used in the manifest file but I didn't get it working successfully.
Re: Win32 embedded WPF form scaling issue in Windows 8+
Posted: Mon Mar 14, 2016 4:01 pm
by JohnD|Dyalog
Hello Norbert,
My understanding is the the dpiAware setting in the dyalog.exe.config file prevents this from happening. However, dpiAware can also be set programmatically, and the interpreter does so if you set the "Enable DPI Scaling of the &interpreter and development environment" check box in the configuration dialog, or set the AUTODPI environment variable.
Regards,
John Daintree.
Re: Win32 embedded WPF form scaling issue in Windows 8+
Posted: Tue Mar 15, 2016 4:42 pm
by norbertjurkiewicz84
Hey John,
Any chance you have an example of setting this up for 14.0? Our main product will be on 14.0 for at least another 2-5 years and our customers are moving to the high DPI environments. The corporate upgrade cycle is crawling and the issue is noticeably a problem that's just going to get bigger.
Norbert.
Re: Win32 embedded WPF form scaling issue in Windows 8+
Posted: Thu Mar 17, 2016 9:53 am
by JohnD|Dyalog
Hi Norbert,
Apologies, it's not the .config file, it's the .manifest file.
See
https://msdn.microsoft.com/en-gb/librar ... 66(v=vs.85).aspx for details.
The gist of it is that a manifest file (dyalog.exe.manifest) of:
Code: Select all
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
Should work.
Note though that Windows does some odd caching here. It seems to remember the the information from invocation to invocation of a program even if you dynamically add or remove the manifest file. Even between reboots. The best I've managed to do is put all the files in a new directory prior to running it the first time, or rename dyalog.exe to dyalog1.exe and the manifest file to dyalog1.exe.manifest. Not my fault, it's Windows doing.
Regards,
John Daintree.
Re: Win32 embedded WPF form scaling issue in Windows 8+
Posted: Thu Mar 31, 2016 3:52 pm
by norbertjurkiewicz84
Hi John,
The manifest file did the trick and changed the look but I'm not sure if for the better... You were right about the caching and .manifest not being applied. Research revealed that changing the dyalog.exe file create and modified dates will reset the cache and the new manifest file will be used.
I used this utility to modify the dates:
http://date.bghot.com/download.phpNorbert