Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function is an application-defined callback function that is called by the EnumDisplayMonitorsfunction.

Syntax

BOOL CALLBACK MonitorEnumProc(
  HMONITOR 
hMonitor,
  HDC 
hdcMonitor,
  LPRECT 
lprcMonitor,
  LPARAM 
dwData
);

Parameters

hMonitor

[in] Handle to the screen. This value should not be NULL.

hdcMonitor

[in] Handle to a device context. The device context should have color attributes that are appropriate for the screen identified by hMonitor. The clipping area of the device context is set to the intersection of the visible region of the device context identified by the hdcparameter of EnumDisplayMonitors, the rectangle pointed to by the lprcClipparameter of EnumDisplayMonitors, and the screen rectangle. This value is NULL if the hdcparameter of EnumDisplayMonitorsis NULL.

lprcMonitor

[in] Pointer to a RECTstructure. If hdcMonitoris not NULL, this rectangle is the intersection of the clipping area of the device context identified by hdcMonitorand the screen rectangle, and the rectangle coordinates are device-context coordinates. If hdcMonitoris NULL, this rectangle is the screen rectangle, and the rectangle coordinates are virtual screen coordinates.

dwData

[in] DWORDthat specifies application-defined data that EnumDisplayMonitorspasses directly to this function.

Return Value

TRUE specifies that you want to continue enumerating screens. FALSE specifies that you want to stop the enumerating screens.

Remarks

EnumDisplayMonitorscalls a specified MonitorEnumProcfunction once for each screen in the calculated enumeration set. EnumDisplayMonitorsalways passes a handle to the screen to MonitorEnumProc.

If the hdcparameter of EnumDisplayMonitorsis not NULL, MonitorEnumProcalso receives a handle to a device context whose color format is appropriate for the screen. You can use this handle to paint into the device context in a manner that is optimal for the screen.

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

Requirements

Header windows.h
Library coredll.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

EnumDisplayMonitors

Other Resources

RECT