Click here to Skip to main content
15,886,693 members
Articles / Desktop Programming / MFC

A Powerful Ownerdraw Menu

Rate me:
Please Sign up or sign in to vote.
4.92/5 (33 votes)
23 Oct 20012 min read 731.1K   9K   111  
An XP-style ownerdrawn menu with support for background images and icon shadow
// MenuXPAppDoc.cpp : implementation of the CMenuXPAppDoc class
//

#include "stdafx.h"
#include "MenuXPApp.h"

#include "MenuXPAppDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMenuXPAppDoc

IMPLEMENT_DYNCREATE(CMenuXPAppDoc, CDocument)

BEGIN_MESSAGE_MAP(CMenuXPAppDoc, CDocument)
	//{{AFX_MSG_MAP(CMenuXPAppDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMenuXPAppDoc construction/destruction

CMenuXPAppDoc::CMenuXPAppDoc()
{
	// TODO: add one-time construction code here

}

CMenuXPAppDoc::~CMenuXPAppDoc()
{
}

BOOL CMenuXPAppDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CMenuXPAppDoc serialization

void CMenuXPAppDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CMenuXPAppDoc diagnostics

#ifdef _DEBUG
void CMenuXPAppDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CMenuXPAppDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMenuXPAppDoc commands

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
China China
I'm a chinese programer living in Shanghai, currently working for a software company whose main business is to deliver computer based testing. Software simulation for computer based testing and certifications is my main responsibility in this company. Execpt for software development, I like out-door activities and photography. I am willing to make friends in China and all over the world, so contact me if you have anything in common with meSmile | :)

Comments and Discussions