Hi, i am writting a small application in win32 API, and i use a ribbon menu ( http://msdn.microsoft.com/en-us/library/dd371191(VS.85).aspx ), but when i get the Device Context of the main windows, and update, the title bar of the windows is redrawed too. So, i try to resize the Device context with a Region, but the opengl doesn’t redraw my window now. How can i do that? (and sorry about my english :S)
My function that initialize opengl is follow :
void Init(HWND hWnd, HDC * hDC, HGLRC * hRC)
{
PIXELFORMATDESCRIPTOR pfd;
int format;
RECT rc;
GetClientRect(hWnd, &rc);
HRGN aaaa ;
aaaa = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
// get the device context (DC)
*hDC = GetDC( hWnd );
SelectObject(*hDC, aaaa);
// set the pixel format for the DC
ZeroMemory( &pfd, sizeof( pfd ) );
pfd.nSize = sizeof( pfd );
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cDepthBits = 16;
pfd.iLayerType = PFD_MAIN_PLANE;
format = ChoosePixelFormat( *hDC, &pfd );
SetPixelFormat( *hDC, format, &pfd );
// create and enable the render context (RC)
*hRC = wglCreateContext( *hDC );
wglMakeCurrent( *hDC, *hRC );
}