Contents

CGDisplaySerialNumber(_:)

Returns the serial number of a display monitor.

Declaration

func CGDisplaySerialNumber(_ display: CGDirectDisplayID) -> UInt32

Parameters

  • display:

    The identifier of the display to be accessed.

Return Value

A serial number for the monitor associated with the specified display, or a constant to indicate an exception—see the discussion below.

Discussion

This function uses I/O Kit to identify the monitor associated with the specified display.

If I/O Kit can identify the monitor:

  • If the manufacturer has encoded a serial number for the monitor, the number is returned.

  • If there is no encoded serial number, 0x00000000 is returned.

If I/O Kit cannot identify the monitor:

  • If a monitor is connected to the display, 0x00000000 is returned.

  • If no monitor is connected to the display hardware, 0xFFFFFFFF is returned.

Note that a serial number is meaningful only in conjunction with a specific vendor and product or model.

See Also

Functions