Click to See Complete Forum and Search --> : Changing Display Configuration


Gervais
January 20th, 2003, 06:54 AM
Hi,

I am mot a C developer, but I try to write à little program that change display configuration settings. I use Win32 API Function:
ChangeDisplaySettings . The return code is SUCCESSFULL but nothing changes on my computer! Someone have an idea?


DEVMODE DevM;
int RetCode;

DevM.dmSize = sizeof(DEVMODE);
DevM.dmDriverExtra=0;

if (0 == EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &DevM)) return 1;

DevM.dmFields = DM_BITSPERPEL || DM_PELSWIDTH || DM_PELSHEIGHT;
DevM.dmBitsPerPel = 32;

RetCode = ChangeDisplaySettings(&DevM,CDS_UPDATEREGISTRY || CDS_GLOBAL);