context menu in XP/2000

In XP/2000 there is a context menu transition effect turned on as default. This effect gives me a incorrect update area in my OpenGL windows, a greay rectangle is painted in the window untill it recives the next OnPaint. I can turn the effect off in the control panel but I suppose there is a better way to solve it…

any suggestions?

So… You are only updating your buffer when you get an OnPaint event? Any window (menus included) that overlaps your buffer will invalidate the area it covers, causing the grey area.

You could try doing your updates in a classic windoze message loop (ie. to make them more frequent) but if what I think is happening is happening then you may be stuck. I’m guessing the effect you mentioned fades in the menu, so for most of the period of the effect it’s transparent. During this time you can see the grey area under the menu, rather than your rendered scene.

I get the gray rect after the menu fades out and just where the selected row in the context menu was (ie not the whole menu just one row). Are there other messages than OnPaint I need to handle?

These transition effect are generally broken.
The menus don’t know that the image underneath is drawn with OpenGL and may have changed during the transition.
Microsoft’s blend effect uses only the first grabbed background image during the whole transition (which is wrong for animated OpenGL windows). If there’s window clipping set by the menu rectangle, OpenGL wouldn’t repaint there anyway.
Your app doesn’t get WM_PAINT messages from popups which save their background image theirselves.
Switching off the transition effect is your only option.

Thanks for the replies. But why do I get a gray rect and not the previous rendered image?

because it does grab the image from the gdi => the standard grey background of your window?

dunno, just a guess…