Show / Hide Table of Contents

Method GetDpiForWindow

| Edit this page View Source

GetDpiForWindow(nint)

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

Declaration
public static uint GetDpiForWindow(nint hwnd)
Parameters
Type Name Description
nint hwnd

The window you want to get information about.

Returns
Type Description
uint

The DPI for the window which depends on the DPI_AWARENESS of the window. See the Remarks for more information. An invalid hwnd value will result in a return value of 0.

Remarks

Learn more about this API from docs.microsoft.com.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX