Hi,
don't know if this will help, but I saw that, in the code you posted, you never do the following:
In my experience, not doing such initializations lead to wierd bugs ...From MSDN:[B]
Before calling EnumDisplaySettings, set the dmSize member to sizeof(DEVMODE), and set the dmDriverExtra member to indicate the size, in bytes, of the additional space available to receive private driver-data.




