GetIntegratedDisplaySize function (sysinfoapi.h)

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

Syntax

HRESULT GetIntegratedDisplaySize(
  [out] double *sizeInInches
);

Parameters

[out] sizeInInches

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

Return value

The result code indicating if the function succeeded or failed.

Remarks

Uses the display driver as the source for display size information. Registry overrides to screen size will not be used. Uses the display adapter connection type to determine which display, if any, is integral to the system. If no internal display detected, an error will be returned. This requires the display to be active to be detected. For example, the lid cannot be closed when the function is called.

To compile an application that uses this function, see Using the Windows Headers.

Examples

The following function displays the best estimate of the diagonal size of the built-in screen, in inches.

void ShowIntegratedDisplaySize()
{
  Platform::String^ buffer;
   
  double sizeInInches;
  HRESULT result = GetIntegratedDisplaySize(&sizeInInches) ;

  if (SUCCEEDED(result))
  {
    buffer += "Internal display size is " + sizeInInches.ToString() + " inches.\n"; 
  }
  else 
  {
    buffer += "No valid Internal display found. \n";
  }

  // Output the string buffer here... 
}

Requirements

Requirement Value
Minimum supported client Windows 10 [desktop apps | UWP apps]
Minimum supported server Windows Server 2016 [desktop apps | UWP apps]
Target Platform Windows
Header sysinfoapi.h
Library onecore.lib
DLL kernelbase.dll

See also

System Information Functions