display

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.

This is sample code. Add error handling and adjust to your requirements as necessary.

#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
Syndicate content