⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 centerchildfrm.cpp

📁 这是MFC经典问答书的光盘内容
💻 CPP
字号:
// CenterChildFrm.cpp : implementation file
//

#include "stdafx.h"
#include "positionview.h"
#include "CenterChildFrm.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCenterChildFrame

IMPLEMENT_DYNCREATE(CCenterChildFrame, CMDIChildWnd)

CCenterChildFrame::CCenterChildFrame()
{
}

CCenterChildFrame::~CCenterChildFrame()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CCenterChildFrame message handlers

int CCenterChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
    // Size the window to 1/4 of the main frame client area size and center it 
    CWnd* pMDIClient = GetParent();
    ASSERT_VALID( pMDIClient );

    CRect rect;
    pMDIClient->GetClientRect( &rect );
	
	MoveWindow(	rect.Width() / 4, rect.Height() / 4,
				rect.Width() / 2, rect.Height() / 2 );

	return 0;
}

⌨️ 快捷键说明

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