Compartilhar via


EnumDisplayDevices (Windows Embedded CE 6.0)

1/6/2010

This function obtains information about the display devices in a system.

Syntax

BOOL EnumDisplayDevices(
  LPCTSTR lpDevice, 
  DWORD iDevNum, 
  PDISPLAY_DEVICE lpDisplayDevice, 
  DWORD dwFlags 
);

Parameters

  • lpDevice
    [in] Pointer to the device name.

    If NULL, the function returns information for the display devices in the system, based on iDevNum.

    For more information, see Remarks.

  • iDevNum
    [in] Index value that specifies the display device of interest.

    The operating system identifies each display device with an index value.

    The index values are consecutive integers, starting at 0.

    If a system has three display devices, for example, they are specified by the index values 0, 1, and 2.

  • lpDisplayDevice
    [out] Pointer to a DISPLAY_DEVICE structure that receives information about the display device specified by iDevNum.

    Before calling EnumDisplayDevices, you must initialize the cb member of DISPLAY_DEVICE to the size, in bytes, of DISPLAY_DEVICE.

  • dwFlags
    [in] Set this parameter to zero.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

The function fails if iDevNum is greater than the largest device index.

Remarks

To query all display devices in the system, call this function in a loop, starting with iDevNum set to 0, and incrementing iDevNum until the function fails.

To select all display devices in the desktop, use only the display devices that have the DISPLAY_DEVICE_ATTACHED_TO_DESKTOP flag in the DISPLAY_DEVICE structure.

To get information about the display device, call EnumDisplayDevices with lpDevice set to NULL. For example, DISPLAY_DEVICE.DeviceString contains the device name.

To obtain information about a display monitor, first call EnumDisplayDevices with lpDevice set to NULL. The device name is returned in lpDisplayDevice. Use this value in lpDevice and set iDevNum to zero in a second call to EnumDisplayDevices. DISPLAY_DEVICE.DeviceString subsequently returns the monitor name.

EnumDisplayDevices assumes that there is only one monitor per display device. It cannot obtain information for multiple monitors attached to a single display device. This behavior differs from Windows-based desktop platforms.

Requirements

Header windows.h
Library coredll.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

GDI Functions
ChangeDisplaySettingsEx
CreateDC
DEVMODE
DISPLAY_DEVICE
EnumDisplaySettings