📄 childfrm.cpp
字号:
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "CustomMenu.h"
#include "ChildFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CMDIChildWnd::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
BOOL CChildFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext)
{
// 1 - Let base class load everything properly, more particularly
// our own menu
if( !CMDIChildWnd::LoadFrame( nIDResource, dwDefaultStyle, pParentWnd, pContext ) )
{
return FALSE;
}
ASSERT( m_hMenuShared != NULL );
// 2 - Get a pointer to our associated menu bar
CMenu* pMenuBar = CMenu::FromHandle( m_hMenuShared );
ASSERT_VALID( pMenuBar );
// 3 - Check if popup was already inserted
CString strItem;
pMenuBar->GetMenuString( POS_COLOR_MENU, strItem, MF_BYPOSITION );
if( strItem != _T( "&Color" ) )
{
// 4 - Insert custom menu in our menu bar
pMenuBar->InsertMenu( POS_COLOR_MENU, MF_POPUP | MF_BYPOSITION,
(UINT) m_ColorMenu.GetSafeHmenu(),
_T( "&Color" ) );
}
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -