GetIntegratedDisplaySize function onecore

double GetIntegratedDisplaySize()

Retrieves the best estimate of the diagonal size of the built-in screen, in inches.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/sysinfoapi/nf-sysinfoapi-getintegrateddisplaysize.

Implementation

double GetIntegratedDisplaySize() {
  final sizeInInches = adaptiveCalloc<Double>();
  final hr$ = HRESULT(_GetIntegratedDisplaySize(sizeInInches));
  if (hr$.isError) {
    free(sizeInInches);
    throw WindowsException(hr$);
  }
  final result$ = sizeInInches.value;
  free(sizeInInches);
  return result$;
}