MONITORENUMPROC callback function

A MonitorEnumProc function is an application-defined callback function that is called by the EnumDisplayMonitors function.

A value of type MONITORENUMPROC is a pointer to a MonitorEnumProc function.

Syntax

MONITORENUMPROC Monitorenumproc;

BOOL Monitorenumproc(
  HMONITOR Arg1,
  HDC Arg2,
  LPRECT Arg3,
  LPARAM Arg4
)
{...}

Parameters

Arg1

Arg2

Arg3

Arg4

Return Value

To continue the enumeration, return TRUE.

To stop the enumeration, return FALSE.

Remarks

You can use the EnumDisplayMonitors function to enumerate the set of display monitors that intersect the visible region of a specified device context and, optionally, a clipping rectangle. To do this, set the hdc parameter to a non-NULL value, and set the lprcClip parameter as needed.

You can also use the EnumDisplayMonitors function to enumerate one or more of the display monitors on the desktop, without supplying a device context. To do this, set the hdc parameter of EnumDisplayMonitors to NULL and set the lprcClip parameter as needed.

In all cases, EnumDisplayMonitors calls a specified MonitorEnumProc function once for each display monitor in the calculated enumeration set. The MonitorEnumProc function always receives a handle to the display monitor.

If the hdc parameter of EnumDisplayMonitors is non-NULL, the MonitorEnumProc function also receives a handle to a device context whose color format is appropriate for the display monitor. You can then paint into the device context in a manner that is optimal for the display monitor.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)

See Also

EnumDisplayMonitors

Multiple Display Monitors Functions

Multiple Display Monitors Overview