Michael Müller michael@fds-team.de writes:
mode.dmSize = sizeof(DEVMODEW);
mode.dmDriverExtra = 0;
if (!EnumDisplaySettingsExW(device.DeviceName, ENUM_CURRENT_SETTINGS, &mode, EDS_RAWMODE))
continue;
memset(info, 0, sizeof(VMRMONITORINFO));
info->guid.pGUID = NULL; /* default DirectDraw device */
info->rcMonitor.left = mode.u1.s2.dmPosition.x;
info->rcMonitor.top = mode.u1.s2.dmPosition.y;
info->rcMonitor.right = mode.u1.s2.dmPosition.x + mode.dmPelsWidth;
info->rcMonitor.bottom = mode.u1.s2.dmPosition.y + mode.dmPelsHeight;
info->hMon = 0; /* FIXME: return monitor handle */
info->dwFlags = (device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) ? MONITORINFOF_PRIMARY : 0;
lstrcpynW(info->szDevice, device.DeviceName, sizeof(info->szDevice)/sizeof(WCHAR));
lstrcpynW(info->szDescription, device.DeviceString, sizeof(info->szDescription)/sizeof(WCHAR));
count++;
info++;
EnumDisplayMonitors would probably be more appropriate.