I have one of those switch views set up to toggle one monitor between two machines and it seems to be stripping off some of the information from the monitor. The monitor's native resolution is 1920x1080@60hz but Windows refuses to let me set it to anything higher than 25hz interlaced, which looks absolutely terrible. I've tried all the drivers and settings suggested by extensive google searching and still nothing.
As a quick project I tried to see if I could force the monitor to a specific display setting using the ChangeDisplaySettingsEx
winapi function but it looks like windows is still checking to make sure the mode is in the incorrect set of supported modes and returns DISP_CHANGE_BADMODE
.
Here's the full function:
WCHAR deviceName[64];
DISPLAY_DEVICE dd;
dd.cb = sizeof(DISPLAY_DEVICE);
int index=0;
while (EnumDisplayDevices(NULL, index++, &dd, 0))
{
// first monitor is the problem one
if (index == 1) {
lstrcpy(deviceName, dd.DeviceName);
}
}
DEVMODE dmScreenSettings;
ZeroMemory(&dmScreenSettings, sizeof(DEVMODE));
dmScreenSettings.dmSize = sizeof(DEVMODE);
dmScreenSettings.dmPelsWidth = 1920;
dmScreenSettings.dmPelsHeight = 1080;
dmScreenSettings.dmBitsPerPel = 32;
dmScreenSettings.dmDisplayFrequency = 60;
dmScreenSettings.dmFields = DM_DISPLAYFREQUENCY | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
LONG res = ChangeDisplaySettingsExW((LPCWSTR) &deviceName, &dmScreenSettings, NULL, CDS_RESET, NULL);
if (res != DISP_CHANGE_SUCCESSFUL)
{
if (res == DISP_CHANGE_BADMODE)
MessageBoxA(NULL, "Bad mode", "Failed", MB_ICONHAND);
else if (res == DISP_CHANGE_BADPARAM)
MessageBoxA(NULL, "Bad Param", "Failed", MB_ICONHAND);
else
MessageBoxA(NULL, "Other error", "Failed", MB_ICONHAND);
}
I've seen How can I force any display resolution/timing I want? and I'd rather not go down the path of using the ATI SDK (I have an ATI Radeon) if at all possible. Any suggestions? I think it would be pretty neat to solve this one with software.