Win32 embedded WPF form scaling issue in Windows 8+

Using Microsoft Windows Presentation Foundation and Syncfusion WPF Libraries

Win32 embedded WPF form scaling issue in Windows 8+

Postby norbertjurkiewicz84 on Mon Feb 29, 2016 4:40 pm

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 :-)
User avatar
norbertjurkiewicz84
 
Posts: 63
Joined: Mon Nov 01, 2010 7:26 pm

Re: Win32 embedded WPF form scaling issue in Windows 8+

Postby JohnD|Dyalog on Mon Mar 14, 2016 4:01 pm

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.
User avatar
JohnD|Dyalog
 
Posts: 74
Joined: Wed Oct 01, 2008 9:35 am

Re: Win32 embedded WPF form scaling issue in Windows 8+

Postby norbertjurkiewicz84 on Tue Mar 15, 2016 4:42 pm

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.
(It's the little things that make the difference :-)
User avatar
norbertjurkiewicz84
 
Posts: 63
Joined: Mon Nov 01, 2010 7:26 pm

Re: Win32 embedded WPF form scaling issue in Windows 8+

Postby JohnD|Dyalog on Thu Mar 17, 2016 9:53 am

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.
User avatar
JohnD|Dyalog
 
Posts: 74
Joined: Wed Oct 01, 2008 9:35 am

Re: Win32 embedded WPF form scaling issue in Windows 8+

Postby norbertjurkiewicz84 on Thu Mar 31, 2016 3:52 pm

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
(It's the little things that make the difference :-)
User avatar
norbertjurkiewicz84
 
Posts: 63
Joined: Mon Nov 01, 2010 7:26 pm


Return to WPF & Syncfusion

Who is online

Users browsing this forum: No registered users and 1 guest