GetDpiForWindow function
Returns the dots per inch (dpi) value for the associated window.
Syntax
UINT WINAPI GetDpiForWindow( _In_ HWND hwnd );
Parameters
- hwnd [in]
-
The window you want to get information about.
Return value
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
The following table indicates the return value of GetDpiForWindow based on the DPI_AWARENESS of the provided hwnd.
| DPI_AWARENESS | Return value |
|---|---|
| DPI_AWARENESS_UNAWARE | 96 |
| DPI_AWARENESS_SYSTEM_AWARE | The system DPI. |
| DPI_AWARENESS_PER_MONITOR_AWARE | The DPI of the monitor where the window is located. |
Requirements
|
Minimum supported client |
Windows 10 [desktop apps only] |
|---|---|
|
Minimum supported server |
None supported |
|
Header |
|
|
Library |
|
|
DLL |
|
See also