diff --git a/WinDevice/Utils/SysInfoUtil.cpp b/WinDevice/Utils/SysInfoUtil.cpp index 6ece8c6..d514c88 100644 --- a/WinDevice/Utils/SysInfoUtil.cpp +++ b/WinDevice/Utils/SysInfoUtil.cpp @@ -264,6 +264,29 @@ int SysInfoUtil::GetInfoByEnumDisplayDevices() return 0; } +void SysInfoUtil::GetInfoByEnumDisplayDevicesA() +{ + DISPLAY_DEVICEA dd; + DEVMODEA dm; + for (int i = 0;; i++) { + ZeroMemory(&dd, sizeof(dd)); + dd.cb = sizeof(dd); + BOOL ret = (EnumDisplayDevicesA(NULL, i, &dd, 0)); + if (ret == FALSE) + break; + ZeroMemory(&dm, sizeof(dm)); + dm.dmSize = sizeof(dm); + if (EnumDisplaySettingsA(dd.DeviceName, ENUM_CURRENT_SETTINGS, &dm)) { + std::cout << "Device #" << i << " Information:" << std::endl; + std::cout << "Device Name: " << dd.DeviceName << std::endl; + std::cout << "Device String: " << dd.DeviceString << std::endl; + std::cout << "State: " << (dd.StateFlags & DISPLAY_DEVICE_ACTIVE ? "Active" : "Inactive") << std::endl; + std::cout << "Device ID: " << dd.DeviceID << std::endl; + std::cout << "Device Key: " << dd.DeviceKey << std::endl; + std::cout << std::endl; + } + } +} void SysInfoUtil::GetInfoByEnumDisplayMonitors() { wcout << "=====GetInfoByEnumDisplayMonitors start=====" << endl;