COffice2003Menu - A menu class with the Office 2003 look.
This class converts your menu into a Office2003 look-a-like.
It supports bitmaps and requires only a small modification of your existing application.

Add an instance of the class to the window that contains the menu:
COffice2003Menu m_Office2003Menu;

On creation of the window attach the COffice2003Menu to the window, this replaces the standard menu.

m_Office2003Menu.Initialize(this, IDR_MAINFRAME, IDB_TOOLBAR);
IDR_MAINFRAME is the ID of the menu
IDB_TOOLBAR is the ID of the bitmaps to use.

Make sure to remove the menu at destruction of the window:

you also need to route the following messages:
void CWnd::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
  CWnd::OnDrawItem(nIDCtl, lpDrawItemStruct);

void CWnd::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
  CWnd::OnMeasureItem(nIDCtl, lpMeasureItemStruct);

and finally to draw the complete menubar in gradient add this to OnNcPaint():

void CWnd::OnNcPaint()
  // paint menu bar

the example contains some code to optimize drawing of the non-client area (to prevent flickering).

Download demo executable

Download source code
This class is part of the Pablo Software Solutions MFC Extension Package - Controls Edition

[Home] [Products] [Source Code] [Downloads] [Support]

© 2015 - Pablo Software Solutions
All rights reserved.