2021年4月7日星期三

How to set DPI awareness of COM class loaded via DllSurrogate

I have tried every single manifest example under the sun in order to get my small application to scale properly (on Windows 8.1). Here's my latest attempt, for example:

<?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>        <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>      </asmv3:windowsSettings>    </asmv3:application>  </assembly>  

Absolutely nothing has worked. So I was wondering if there's something else that needs to be done. My application is a COM Dll that's loaded out of process via DllSurrogate. Is there something else that should be added (maybe a commmand line flag or something) in order to get awareness to kick in? Calling SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE) does work, actually, but the docs discourage making API calls in lieu of the manifest approach. Thank you for any help!

https://stackoverflow.com/questions/66994620/how-to-set-dpi-awareness-of-com-class-loaded-via-dllsurrogate April 08, 2021 at 05:55AM

没有评论:

发表评论