Windows XP introduced Visual Styles as a mechanism for providing more visual appeal to windows and controls. Menus, however, were not rendered using visual styles for Windows XP. With Windows Vista menus now are part of the visual schema and are rendered using the visual styles engine.
Whenever we add new features to existing code, especially code with a long history like the Window Manager, we have to be careful not to break existing application behavior. In the context of menus there are a few situations that require us to disable visual style rendering:
· Owner-draw items (MFT_OWNERDRAW)
· Menu breaks (MFT_MENUBREAK or MFT_MENUBARBREAK)
· Use of HBMMENU_CALLBACK to defer bitmap rendering
· Using a destroyed menu handle
The reasoning for each of these may be discussed in a future blog entry. For the time being it’s only important for you to understand what may be causing your menu to render without visual styling.
Microsoft, Windows Vista, Vista Style Menus, Guide