Menu items Flicker on resize

Thanks guys for your help, it bothered me for a couple of days.

I am using Windows Vista and am writing my C ++ program using the direct Windows API (no MFC).

When I resize the window, the menu items flicker. My window class does NOT use CS_HREDRAW or CS_VREDRAW. I am using double buffering for CLIENT AREA so the client area does not flicker, just the menu on the non-client area.

Now I can get this to go away by handling the WM_NCPAINT myself, but I really don't want to process the entire non-client area drawing. I also handle WM_ERASEBKGND, but that only helps for CLIENT AREA. I really don't understand how to fix this. I have searched google extensively, and have read and tried everything

http://catch22.net/tuts/flicker

offered. Thanks again to you guys. Hopefully you can help me understand why my menu items are flickering (although not in the menu bar, nor in the borders, nor in the title bar of the window).

+1


source to share


1 answer


I'm happy to say that I fixed the problem! I just pass WS_EX_COMPOSITED to create a window with a menu bar using CreateWindowEx ()! Works great and also takes care of the flicker of baby windows. I guess I would share this with you guys just in case you experience the same annoying flicker.



+2


source







All Articles