Multiple Display Monitors

The system supports an unlimited number of display monitors per window station. The monitors can be arranged in a way that creates a contiguous region. The size and color depth of each monitor can be set independently.

The bounding rectangle of all monitors makes up the virtual screen. The desktop window covers the entire virtual screen, rather than the screen of a single monitor. Because existing applications expect one monitor with an origin (0, 0), the virtual screen must contain one monitor with the origin (0, 0). This monitor is known as the primary monitor.

The following illustration shows a possible arrangement of three monitors.

Each physical display device is represented by a monitor handle of type HMONITOR. A display monitor has the same HMONITOR value throughout its lifetime.

Any Win32 function that returns a display device context (DC) returns a DC for the primary monitor. To obtain a DC for another monitor, use the EnumDisplayMonitors function. The system calls your callback function for each monitor, passing it a DC for the monitor. You can use this DC to paint on that monitor.

The following functions enable you to position objects on the appropriate monitor: GetMonitorInfo, MonitorFromPoint, MonitorFromRect, and MonitorFromWindow.