formframe.cpp

来自「编程实例」· C++ 代码 · 共 67 行

CPP
67
字号
// FormFrame.cpp : implementation file
//

#include "stdafx.h"
#include "myUI.h"
#include "FormFrame.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFormFrame

IMPLEMENT_DYNCREATE(CFormFrame, CFrameWnd)

CFormFrame::CFormFrame()
{
}

CFormFrame::~CFormFrame()
{
}


BEGIN_MESSAGE_MAP(CFormFrame, CFrameWnd)
	//{{AFX_MSG_MAP(CFormFrame)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFormFrame message handlers

int CFormFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	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;
}

BOOL CFormFrame::PreCreateWindow(CREATESTRUCT& cs) 
{
	// TODO: Add your specialized code here and/or call the base class
	// Make the frame window non-resizable
	cs.style &= ~WS_THICKFRAME;
	cs.style &= ~WS_MAXIMIZEBOX;

	return CFrameWnd::PreCreateWindow(cs);
}

⌨️ 快捷键说明

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