A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



EnumDisplayMonitors

The EnumDisplayMonitors function enumerates display monitors (including invisible pseudo-monitors associated with the mirroring drivers) that intersect a region formed by the intersection of a specified clipping rectangle and the visible region of a device context. EnumDisplayMonitors calls an application-defined MonitorEnumProc callback function once for each monitor that is enumerated. Note that GetSystemMetrics(SM_CMONITORS) counts only the display monitors.

VB4-32,5,6
Declare Function EnumDisplayMonitors Lib "user32.dll" (ByVal hdc As Long, ByRef lprcClip As Any, ByVal lpfnEnum As Long, ByVal dwData As Long) As Long

Operating Systems Supported
Requires Windows 2000 or later; Requires Windows 98 or later

Library
User32

Parameter Information
- hdc
[in] Handle to a display device context that defines the visible region of interest.
If this parameter is NULL, the hdcMonitor parameter passed to the callback function will be NULL, and the visible region of interest is the virtual screen that encompasses all the displays on the desktop.

- lprcClip
[in] Pointer to a RECT structure that specifies a clipping rectangle. The region of interest is the intersection of the clipping rectangle with the visible region specified by hdc.
If hdc is non-NULL, the coordinates of the clipping rectangle are relative to the origin of the hdc. If hdc is NULL, the coordinates are virtual-screen coordinates.

This parameter can be NULL if you don't want to clip the region specified by hdc.

- lpfnEnum
[in] Pointer to a MonitorEnumProc application-defined callback function.

- dwData
[in] Application-defined data that EnumDisplayMonitors passes directly to the MonitorEnumProc function.

Return Values
TRUE indicates success. FALSE indicates failure, or that lpfnEnum is NULL. To get extended error information, call GetLastError. When lpfnEnum is NULL, GetLastError returns ERROR_INVALID_PARAMETER.

Last update: 07 April 2006