 |
| How to detect if additional monitor is connected and active |
User rating: 9/10 (1 votes) | |
|
|
 |
 |
Versions: click to open |
 |
|
 |
 |
| Before you begin: |
 |
Nowadays having two monitors connected to a PC becomes more a common place rather than exception. This code sample explains how to detect all available monitors through enumerating display devices and their properties.

See also:
How to change display settings: screen resolution, screen refresh rate
How to adjust monitor brightness (Vista, monitor with DDC support)
|
 |
 |
| |
| |
Members area. Log in to view this example. |
|
| |
|
|
|
|
|
 |
User rating: 9/10 (1 votes) | |
| 4378 bytes Created: 2008-12-09 14:50:37 Modified: 2010-12-22 20:36:24 Visits in 7 days: 143 |
|
 |
 |
| Listed functions: |
 |
|
 |
 |
| My comment: |
 |
In the cursor created by this code sample, each connected monitor is indicated by non-empty MonitorName value.
For an active monitor (the desktop extends to such monitor), several other values are populated:
Screenwidth
Screenheight
Bitsperpixel
DsppositionX
DsppositionY
From the screen dimensions and the display position it is possible to determine whether a given window is visible on a particular display.
* * *
Read Two monitors are better than one by Tony Northrup published on Microsoft website. Bet he might be busy writing a sequel "N+1 monitors better than N".
* * *
Some graphics cards and external units (Matrox) support connections to three and more monitors. |
 |
 |
| Word Index links for this example: |
 |
|
|
 |
 |
| Translate this page: |
 |
|