GetDpiForWindow

Description

Retrieves the current DPI value for a specified PowerBuilder object.

Syntax

GetDpiForWindow (PowerObject p)

Argument

Description

p

The PowerBuilder object (such as a window or any visible object in the window) whose DPI value you want to retrieve.


Return value

Integer.

Returns the DPI value of the specified object.

Usage

This function can be used to implement custom DPI-aware control resizing and scaling logic.

Examples

The following example gets the DPI value of the w_main window.

// Enable Per-Monitor V2 DPI awareness
Application.SetHighDpiMode(4)

// Retrieve the DPI of a window
Integer li_dpi
li_dpi = GetDpiForWindow(w_main)
MessageBox("Current DPI", String(li_dpi))

See also

SetHighDpiMode