Page 1 of 1

Add manifest to set DPI Aware with wxWidgets 3.1.x

Posted: Sat May 25, 2019 11:39 am
by rocrail
Hi,

I open a new Topic for this.
Already I posted this issue here
viewtopic.php?f=1&t=45840
But this thread is solved.

The problem is how to set DPIProcessAware with wxWidgets 3.1.x because this call is no longer in the wxEntry of wxWidgets.
I tried to include an extra rocview.manifest:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0' xmlns:asmv3='urn:schemas-microsoft-com:asm.v3'>
  <asmv3:application>
    <asmv3:windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
      <!-- fallback for Windows 7 and 8 -->
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness>
      <!-- falls back to per-monitor if per-monitor v2 is not supported -->
      <!-- <gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">true</gdiScaling> -->
      <!-- enables GDI DPI scaling -->
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>
But Windows does not care about it and the application ist flagged as not aware and is ugly scaled.

Any sugestions are highly appreciated.

Re: 3.1+ doesn't make the SetDPIProcessAware() call anymore

Posted: Sat May 25, 2019 11:42 am
by rocrail
This is how I embedded the manifest in the rocview application:

rocview.rc:

Code: Select all

#include "wx/msw/wx.rc"
wxDEFAULT_FRAME ICON "xpm/rocrail.ico"
wxMANIFEST_ID 25 "rocview.manifest"

Re: 3.1+ doesn't make the SetDPIProcessAware() call anymore

Posted: Sat May 25, 2019 12:02 pm
by doublemax
wxWidgets already has its own manifest in include/wx/msw/wx.manifest and amd64.manifest
I'm not sure if it's possible to have more than one.

Try to combine the contents of the wx manifest and yours into one and then use this in your .rc file:

Code: Select all

#define wxUSE_NO_MANIFEST 1
#include "wx/msw/wx.rc"

#ifdef ISOLATION_AWARE_ENABLED
#define wxMANIFEST_ID 2
#else
#define wxMANIFEST_ID 1
#endif

wxMANIFEST_ID 24 "rocview.manifest"
Eventually, use resource hacker to check if the manifest was embedded correctly:
http://www.angusj.com/resourcehacker/

Re: 3.1+ doesn't make the SetDPIProcessAware() call anymore

Posted: Sat May 25, 2019 12:30 pm
by rocrail
OK, I will try this and report back.

Re: 3.1+ doesn't make the SetDPIProcessAware() call anymore

Posted: Sat May 25, 2019 12:34 pm
by rocrail
Indeed this will do the trick.
Thank you very much. :D

Maybe its a good idea to document this in the Wiki and/or API documentation.