Supporting Per-Monitor (V2) DPI Awareness

For applications developed using raw Win32 programming or Windows Forms (such as PowerBuilder applications), Microsoft supports the following modes for automatic DPI scaling management.

  • DPI Unaware -- No scaling support, static at 96 DPI.

  • System DPI Awareness -- Scales based on system DPI, but doesn't adjust dynamically for different monitors.

  • Per Monitor (V1) DPI Awareness -- Scales based on the DPI of the monitor the app is on.

  • Per-Monitor (V2) DPI Awareness -- Full dynamic scaling based on the monitor and window state.

  • DPI Unaware GDI Scaled -- GDI scaling applied when running on high-DPI displays, but not ideal quality.

For more detailed information, please refer to Microsoft's documentation: 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.

PowerBuilder 2025 optimizes its DPI-aware scaling algorithm to support the "Per-Monitor (V2) DPI Awareness" mode. For applications developed in PowerBuilder 2025, the "Per-Monitor (V2) DPI Awareness" mode (4 - PerMonitorV2) will be automatically selected. (For applications upgraded to PowerBuilder 2025, the "DPI Unaware" mode will be automatically used.)

When the Per-Monitor (V2) DPI Awareness mode is used, the DPI scaling will be handled by PowerBuilder together with Windows OS, to ensure all Ul elements will automatically scale proportionally according to Windows' scaling settings.

PowerBuilder 2025 will handle DPI scaling for the following:

  • PowerBuilder windows

  • PowerBuilder native controls

  • Any other Ul elements that are not handled by Windows OS.

Windows OS will handle DPI scaling for the following:

  • Automatic non-client area (window caption, scroll bars, etc.)

  • Win32 dialogs (e.g. from PowerBuilder MessageBox)

  • Theme-drawn bitmap assets in common controls (checkboxes, button backgrounds, etc.)

Unsupported features or limitations

1) For other DPI scaling modes, PowerBuilder 2025 provides no optimization. If you select these modes, your PowerBuilder application will rely entirely on Windows for automatic scaling. Please run comprehensive testing to ensure that the scaling results meet your expectations.

2) PowerBuilder IDE does not support DPI scaling. When you run the application from the PowerBuilder IDE, the DPI mode has no effect to the application UI. To view the effects, you need to compile the application as an executable file. To do this:

  1. Open the application object painter, go to the application's Properties view, select PerMonitorV2(4) --- Default from the HighDpiMode property listbox, and then compile the application as an exe file.

  2. Run the application executable file, and then change the Windows scaling size.

  3. Every time when you change the Windows scaling size, restart the application and then verify that the text and controls remain clear and appropriately sized.

3) The DPI mode (including Per-Monitor (V2) DPI Awareness) is not well supported in the multi-monitor environment. For more, refer to Unsupported features.