Add manifest to set DPI Aware with wxWidgets 3.1.x Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Add manifest to set DPI Aware with wxWidgets 3.1.x

Post 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.
Last edited by rocrail on Sat May 25, 2019 1:44 pm, edited 2 times in total.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

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

Post 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"
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post 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/
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

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

Post by rocrail »

OK, I will try this and report back.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

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

Post 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.
Best regards,
Rob.
https://wiki.rocrail.net
Post Reply