Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Is Per-Monitor V2 (PMv2) awareness supported in Delphi 10.2.2?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Feb 27, 2018 4:10 PM Last Post By: R Greg Dawson
Gerben Abbink

Posts: 1
Registered: 5/22/13
Is Per-Monitor V2 (PMv2) awareness supported in Delphi 10.2.2?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 18, 2018 9:01 AM
If i check the "Enable High-DPI" checkbox for my application and at runtime call GetThreadDpiAwarenessContext() and GetAwarenessFromDpiAwarenessContext(), PROCESS_PER_MONITOR_DPI_AWARE is returned. Microsoft calls this Per-Monitor V1 (PMv1) awareness.

According to Microsoft Per-Monitor V1 (PMv1) awareness is very limited. It is recommended that applications use PMv2.

Is PMv2 supported in Delphi 10.2.2? Will it be supported in 10.2.3.?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Is Per-Monitor V2 (PMv2) awareness supported in Delphi 10.2.2?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2018 2:48 PM   in response to: Gerben Abbink in response to: Gerben Abbink
Gerben Abbink wrote:

Is PMv2 supported in Delphi 10.2.2? Will it be supported in 10.2.3.?

Additional support for High DPI has been announced for 10.3, but
specific details about what that entails have not been reveiled yet.

--
Remy Lebeau (TeamB)
R Greg Dawson

Posts: 1
Registered: 6/17/98
Re: Is Per-Monitor V2 (PMv2) awareness supported in Delphi 10.2.2?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 27, 2018 4:05 PM   in response to: Gerben Abbink in response to: Gerben Abbink
Gerben Abbink wrote:
If i check the "Enable High-DPI" checkbox for my application and at runtime call GetThreadDpiAwarenessContext() and GetAwarenessFromDpiAwarenessContext(), PROCESS_PER_MONITOR_DPI_AWARE is returned. Microsoft calls this Per-Monitor V1 (PMv1) awareness.

According to Microsoft Per-Monitor V1 (PMv1) awareness is very limited. It is recommended that applications use PMv2.

Is PMv2 supported in Delphi 10.2.2? Will it be supported in 10.2.3.?

You can define PerMonitorV2 awareness using a custom manifest file (instead of just checking "Enable High-DPI", which gives you V1.

Here is an example custom manifest file I use...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="*"/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>True/PM</dpiAware>
</asmv3:windowsSettings>
<asmv3:windowsSettings
xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<dpiAwareness>PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

This gives me the benefits of PerMonitorV2. As I recall, it was not something I could do programatically.

--R Greg Dawson

Edited by: Robert Dawson on Feb 27, 2018 4:09 PM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02