我需要帮助获取屏幕分辨率,就像下面的图片所示。
我找到了这篇文档,对我非常有帮助。以下是我基于该文档尝试的代码:
int numberOfScreens = GetSystemMetrics(SM_CMONITORS);
int width = GetSystemMetrics(SM_CXSCREEN);
int height = GetSystemMetrics(SM_CYSCREEN);
std::cout << "Number of monitors: " << numberOfScreens << "\n"; // returns 3
std::cout << "Width:" << width << "\n";
std::cout << "Height:" << height << "\n";
然而,它只能识别并提供关于主监视器的信息。我如何获取其他监视器的信息呢?