User32EnableNonClientDpiScaling Method

In high-DPI displays, enables automatic display scaling of the non-client area portions of the specified top-level window. Must be called during the initialization of that window.

Note: Applications running at a DPI_AWARENESS_CONTEXT of DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 automatically scale their non-client areas by default. They do not need to call this function.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", ExactSpelling = true, SetLastError = true)]
public static bool EnableNonClientDpiScaling(
	IntPtr hWnd
)

Parameters

hWnd  IntPtr
The window that should have automatic scaling enabled.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

Remarks

See Also