Win32 embedded WPF form scaling issue in Windows 8+
5 posts
• Page 1 of 1
Win32 embedded WPF form scaling issue in Windows 8+
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.
(It's the little things that make the difference :-)
-
norbertjurkiewicz84 - Posts: 63
- Joined: Mon Nov 01, 2010 7:26 pm
Re: Win32 embedded WPF form scaling issue in Windows 8+
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.
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.
-
JohnD|Dyalog - Posts: 74
- Joined: Wed Oct 01, 2008 9:35 am
Re: Win32 embedded WPF form scaling issue in Windows 8+
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.
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.
(It's the little things that make the difference :-)
-
norbertjurkiewicz84 - Posts: 63
- Joined: Mon Nov 01, 2010 7:26 pm
Re: Win32 embedded WPF form scaling issue in Windows 8+
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:
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.
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.
-
JohnD|Dyalog - Posts: 74
- Joined: Wed Oct 01, 2008 9:35 am
Re: Win32 embedded WPF form scaling issue in Windows 8+
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.php
Norbert
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.php
Norbert
(It's the little things that make the difference :-)
-
norbertjurkiewicz84 - Posts: 63
- Joined: Mon Nov 01, 2010 7:26 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group