User32GetDpiForWindow Method

Returns the dots per inch (dpi) value for the associated window.

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 uint GetDpiForWindow(
	IntPtr hWnd
)

Parameters

hWnd  IntPtr
The window you want to get information about.

Return Value

UInt32
The DPI for the window which depends on the DpiAwareness of the window.

An invalid hWnd value will result in a return value of 0.

Remarks

See Also