Working with a double-buffered window, I have a problem that when I make my parent window fullscreen (just covering the whole screen using the method in this answer, or using ChangeDisplaySettings with CDS_FULLSCREEN both show the problem), any child windows it has are not drawn/visible. However, this only happens if the window has focus / is the active window. I have been banging my head against this for a very long time (2+ years) and have finally started caring enough to try and figure this out.
Specific setup:
- This is an OpenGL window, double-buffered
- Parent is drawn before child is drawn and both are receiving WM_PAINT messages
- Drawing is done outside WM_PAINT BeginPaint/EndPaint pairs by simply making the Device Context of the window to draw current. However, an older version of the code did confine all drawing to inside Begin-/EndPaint, and I had the same problem.
- Parent window styles when fullscreen, as given by WinSpy++ (consistent with what i request in code): WS_OVERLAPPEDWINDOW, WS_VISIBLE, WSCLIPSIBLINGS, WS_CLIPCHILDREN (though caption removed by this method and is indeed not present, seems winspy doesn't show this), no active WS_EX styles
- Child window: WS_CHILD, WS_VISIBLE, WSCLIPSIBLINGS, WS_CLIPCHILDREN, no WS_EX
- Code handling WM_SETFOCUS: DefWindowProc() for return value of my window proc, SetActiveWindow(), UpdateWindow()
- Code handling WM_KILLFOCUS: only DefWindowProc() for return value of my window proc
- WM_ACTIVATE is passed to DefWindowProc().
- I have seen this problem on at least windows 7 and 8, with various versions of MSVC and the windows SDK.
- Is there any other info i can add?
Lastly, this concerns the code of FreeGLUT, try the resizer demo in svn trunk should you want to see the problem in action. After starting the demo, press c to open a child window, and then f to make things fullscreen.