DEVMODE lpDevMode; lpDevMode.dmBitsPerPel = 32; lpDevMode.dmPelsWidth = 1024; lpDevMode.dmPelsHeight = 768; lpDevMode.dmSize = sizeof(lpDevMode); lpDevMode.dmFields = DM_PELSWIDTH | DM_BITSPERPEL | DM_PELSHEIGHT; LONG res; res = ChangeDisplaySettings(&lpDevMode, 0);