Don' know how to fill DEVMODE parameter in ChangeDisplaySettings()?

Hello, I am a beginner in opengl…
I have to display the result in full screen.
I have search for “ChangeDisplaySettings()”
but none of them answer how to fill the
DEVMODE parameter…

I am newbie to opengl and an beginner to mfc
(or win32) as well.
Can anybody give me a simple example on how to fill DEVMODE parameter?

Help please…I am stuck for long hours over full screen…

Maybe this code would help you

DEVMODE dmScreenSettings; //acess for the struct

memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); dmScreenSettings.dmSize = sizeof(DEVMODE);
dmScreenSettings.dmPelsWidth = SCREEN_WIDTH;
dmScreenSettings.dmPelsHeight= SCREEN_HEIGHT;
dmScreenSettings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;

ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);

Other usefull fields are dmBitsPerPel (colordepth) and dmFrequency (refresh rate). Just make sure you or in DM_BITSPERPEL and/or DM_FREQUENCY.

Great!Fast and excellent response…

Furthermore, I am using MFC with mulitple document.
In which position should i place this code
into …

in fact, i have tried to put those
inside onpaint. But that the screen area outside the window is
flickering …
it seems that there are some other code reset
to original window size …

Can you help please…?

Do you have tried to use SwapBuffer(hDC);

maybe that would help to solve your Problem