GetDpiForMonitor function shcore

void GetDpiForMonitor(
  1. HMONITOR hmonitor,
  2. MONITOR_DPI_TYPE dpiType,
  3. Pointer<Uint32> dpiX,
  4. Pointer<Uint32> dpiY,
)

Queries the dots per inch (dpi) of a display.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/shellscalingapi/nf-shellscalingapi-getdpiformonitor.

Implementation

@pragma('vm:prefer-inline')
void GetDpiForMonitor(
  HMONITOR hmonitor,
  MONITOR_DPI_TYPE dpiType,
  Pointer<Uint32> dpiX,
  Pointer<Uint32> dpiY,
) {
  final hr$ = HRESULT(_GetDpiForMonitor(hmonitor, dpiType, dpiX, dpiY));
  if (hr$.isError) throw WindowsException(hr$);
}