Applies to
Application object
Description
Specifies the DPI (Dots Per Inch) awareness mode.
The value can be one of the following:
-
0 - None. If a PowerBuilder application is upgraded from an earlier version, it will be set to 0 by default.
-
1 - DpiUnaware. This is the default behavior in Windows. For the time being, it has the same effect as 0.
-
2 - SystemAwareness
-
3 - PerMonitor
-
4 (Default) - PerMonitorV2. If a new PowerBuilder application is created from scratch, it will be set to 4 by default.
-
5 - DpiUnawareGdiScaled
For details about the awareness mode, refer to https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows and https://learn.microsoft.com/en-us/windows/win32/hidpi/dpi-awareness-context.
When the DPI mode is 0, you can call the SetHighDPIMode function to set the awareness mode.
When the DPI mode is any value between 1 and 5 (inclusive), you cannot call the SetHighDPIMode function to change the mode. The SetHighDPIMode function calls will fail and return -1.
Usage
In a painter
To set HighDPIMode property for the application:
-
Select a DPI mode from the HighDPIMode list box on the General page of the application's Properties view.
In scripts
The HighDPIMode property can be called in the script to get the DPI awareness mode; but not to set the awareness mode. (To set the awareness mode in the script, you can try with the SetHighDPIMode function).
Therefore, the following script is unsupported:
GetApplication().HighDpiMode = 5 //unsupported