(First, declare the device mode class)
DEVMODE NewDevice;
(The members of this class you will need)
NewDevice.dmSize = sizeof(DEVMODE);
NewDevice.dmPelsWidth = 1024;
NewDevice.dmPelsHeight = 768;
(In the main program)
ChangeDisplaySettings(&NewDevice, 0);