The device name is very internal and likely of little use to a user.
Instead give the more user friendly string we can get out of the system.
for (iter = sys_monitors.begin(); iter != sys_monitors.end(); ++iter) {
MONITORINFOEX info;
+ DISPLAY_DEVICE dev;
info.cbSize = sizeof(info);
GetMonitorInfo(*iter, (LPMONITORINFO)&info);
if ((info.rcMonitor.bottom - info.rcMonitor.top) != h)
continue;
- return info.szDevice;
+ dev.cb = sizeof(dev);
+ EnumDisplayDevices(info.szDevice, 0, &dev, 0);
+
+ return dev.DeviceString;
}
return "";