BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
int *Count = (int*)dwData;
(*Count)++;
return TRUE;
}
int MonitorCount()
{
int Count = 0;
if (EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&Count))
return Count;
return -1;//signals an error
}
参考地址:http://stackoverflow.com/questions/7767036/how-do-i-get-the-number-of-displays-in-windows

这篇博客介绍了如何在Windows操作系统中获取当前连接的显示设备的数量,提供了相关链接到Stack Overflow的问题解答。

412

被折叠的 条评论
为什么被折叠?



