User32EnumDisplayMonitors Method

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(IntPtr, IntPtr, DelegatesEnumMonitorProc, IntPtr) calls an application-defined DelegatesEnumMonitorProc callback function once for each monitor that is enumerated.

Note that GetSystemMetrics (SM_CMONITORS) counts only the display monitors.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll")]
public static bool EnumDisplayMonitors(
	IntPtr hdc,
	IntPtr lprcClip,
	DelegatesEnumMonitorProc lpfnEnum,
	IntPtr dwData
)

Parameters

hdc  IntPtr
A handle to a display device context that defines the visible region of interest.

If this parameter is Zero, the hdcMonitor parameter passed to the DelegatesEnumMonitorProc function will be Zero, and the visible region of interest is the virtual screen that encompasses all the displays on the desktop.

lprcClip  IntPtr
A pointer to a NativeRectangle 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 not Zero, the coordinates of the clipping rectangle are relative to the origin of the hdc.

If hdc is Zero, the coordinates are virtual-screen coordinates.

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

lpfnEnum  DelegatesEnumMonitorProc
A pointer to a DelegatesEnumMonitorProc application-defined callback function..
dwData  IntPtr
Application-defined data that EnumDisplayMonitors(IntPtr, IntPtr, DelegatesEnumMonitorProc, IntPtr) passes directly to the DelegatesEnumMonitorProc function.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

Remarks

See Also