Detect Multiple Monitors

The GetSystemMetrics

WIN API can be used to get the number of monitors. Some other constants related to multi-monitor PC configurations are also included.

$SAMPLECODE$

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

#DEFINE SM_XVIRTUALSCREEN 76
#DEFINE SM_YVIRTUALSCREEN 77
#DEFINE SM_CXVIRTUALSCREEN 78
#DEFINE SM_CYVIRTUALSCREEN 79
#DEFINE SM_CMONITORS 80
DECLARE Long GetSystemMetrics IN user32 Long nIndex
lnNonitors = GetSystemMetrics(SM_CMONITORS)
? lnNonitors

Doug Hennig posted nice Multiple Monitor Class that handles multiple monitors.

Comments