GetIntegratedDisplaySize function

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

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

Syntax

HRESULT GetIntegratedDisplaySize(
  double *sizeInInches
);

Parameters

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, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers.

Examples

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

C++
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

   
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 Kernel32.lib
DLL Kernel32.dll

See Also

System Information Functions