Click here to Skip to main content
15,896,153 members
Articles / Mobile Apps / Windows Mobile

CmenuModifier - An Owner Draw Image Menu

Rate me:
Please Sign up or sign in to vote.
3.92/5 (10 votes)
3 Jun 2008CPOL6 min read 48.9K   1.8K   23  
CmenuModifier - an owner draw image menu
// MDIView.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "MDIView.h"

#include "ZFrm.h"
#include "ZChild.h"
#include "ZDoc.h"
#include "ZView.h"

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

/////////////////////////////////////////////////////////////////////////////
// ZApp

BEGIN_MESSAGE_MAP(ZApp, CWinApp)
	//{{AFX_MSG_MAP(ZApp)
	ON_COMMAND(M0_HELP, On_Help)
	//}}AFX_MSG_MAP
	// Standard file based document commands
	ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
	ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// ZApp construction

ZApp::ZApp()
{
}

/////////////////////////////////////////////////////////////////////////////
// The one and only ZApp object

ZApp theApp;

/////////////////////////////////////////////////////////////////////////////
// ZApp initialization

BOOL ZApp::InitInstance()
{
	AfxEnableControlContainer();

	// Standard initialization

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	// Change the registry key under which our settings are stored.
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));

	LoadStdProfileSettings();  // Load standard INI file options (including MRU)

	// Register document templates

	CMultiDocTemplate* pDocTemplate;
	pDocTemplate = new CMultiDocTemplate(
		IDR_MDIVIETYPE,
		RUNTIME_CLASS(ZDoc),
		RUNTIME_CLASS(ZChild), // custom MDI child frame
		RUNTIME_CLASS(ZView));
	AddDocTemplate(pDocTemplate);

	// create main MDI Frame window
	ZFrm* pMainFrame = new ZFrm;
	if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
		return FALSE;
	m_pMainWnd = pMainFrame;

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

	pMainFrame->ShowWindow(m_nCmdShow);
	pMainFrame->UpdateWindow();

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// ZApp message handlers

void ZApp::On_Help() 
{
	::ShellExecute(0,0,"..\\..\\Help\\Help.htm",0,0,SW_SHOW);
	::ShellExecute(0,0,"..\\Help\\Help.htm",0,0,SW_SHOW);
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Australia Australia

Please visit our Download Home to obtain many interesting software for free ...


Comments and Discussions