ekfixedformframe.cpp

来自「< MFC经典问答>>是微软类库经常遇到的问题」· C++ 代码 · 共 68 行

CPP
68
字号
// EkFixedFormFrame.cpp : implementation file
//

#include "stdafx.h"

#include "EkFixedFormFrame.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEkFixedFormFrame

IMPLEMENT_DYNCREATE(CEkFixedFormFrame, CMDIChildWnd)

CEkFixedFormFrame::CEkFixedFormFrame()
{
}

CEkFixedFormFrame::~CEkFixedFormFrame()
{
}


BEGIN_MESSAGE_MAP(CEkFixedFormFrame, CMDIChildWnd)
	//{{AFX_MSG_MAP(CEkFixedFormFrame)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEkFixedFormFrame message handlers

BOOL CEkFixedFormFrame::PreCreateWindow(CREATESTRUCT& cs) 
{
	// Make the frame window non-resizable
	cs.style &= ~WS_THICKFRAME;
	cs.style &= ~WS_MAXIMIZEBOX;

	return CMDIChildWnd::PreCreateWindow(cs);
}

int CEkFixedFormFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// The child FormView should already have been created
	// by the call to CMDIChildWnd::OnCreate()
	CFormView* pFormView = static_cast< CFormView* >
								( GetDescendantWindow( AFX_IDW_PANE_FIRST, TRUE ) );
	ASSERT_VALID( pFormView );
	ASSERT_KINDOF( CFormView, pFormView );

	// Make sure that the view window size is correctly set
	RecalcLayout();

	// Make the view resize its parent frame -- that is
	// "us", normally !
	pFormView->ResizeParentToFit( FALSE );
	pFormView->ResizeParentToFit( TRUE );

	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?