menu dropshadow flickers when ontop of MDI child window
-
background info: i currently have an MDI app (created with Visual Studio .NET 2003) that can properly create new child windows. each of these windows contains a rendered scene via OpenGL. all of my OpenGL calls are invoked from within an overloaded OnPaint() method. i enabled double-buffering so animations are smooth. i also overloaded the OnEraseBkgnd() method so the background will not be repainted when the child window is resized. the problem: when i make a selection from the main menu bar i noticed the menu dropshadow flickers when it occludes/overlays a portion of the child window. my first assumption was that my scenes were too complex; the flickering exposes the slow "repaints" of the scene. as such, i made the necessary changes so that each child window only displays a blank grey background. the problem, however, persists for even this most simple of scenes. i next looked up the online documentation regarding the CWnd::OnPaint() method. the docs state the framework calls OnPaint() only once by default. to verify this i set a breakpoint in my OnPaint() method only to discover it gets called dozens of times! i suspect the flickering is due to the framework calling the OnPaint() over and over and over again. an artifact from the time-consuming "repaints" is this flickering of the menu dropshadows. does anyone have any suggestions on how to ensure that OnPaint() is only called when necessary? any help would be greatly appreicated. thanks.