可以通过CMenu的DrawItem修改条目的颜色等,
但如何改变边框的呢?

解决方案 »

  1.   

    可hook菜单窗口产生的消息wm_create,然后对这个窗口进行子类化.http://www.codeproject.com/menu/trans_menu.asp
    上面这个例子是通过对菜单窗口子类化并加上层风格使其变成半透明的.里面有几句代码被注释,加上这几句代码就能把边框去掉了.http://www.codeproject.com/menu/SkinMenu.asp
      

  2.   

    继承 CMenu
    override DrawItem function !virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );ParameterslpDrawItemStructA pointer to a DRAWITEMSTRUCT structure that contains information about the type of drawing required.ResCalled by the framework when a visual aspect of an owner-drawn menu changes. The itemAction member of the DRAWITEMSTRUCT structure defines the drawing action that is to be performed. Override this member function to implement drawing for an owner-draw CMenu object. The application should restore all graphics device interface (GDI) objects selected for the display context supplied in lpDrawItemStruct before the termination of this member function.See CWnd::OnDrawItem for a description of the DRAWITEMSTRUCT structure.