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

📄 systemmsgview.cpp

📁 这是一个有关网络游戏平台编程中的一些例子
💻 CPP
字号:
// systemmsgview.cpp : implementation file
//

#include "stdafx.h"
#include "..\GameHigh.h"
#include "..\include\systemmsgview.h"
#include "macros.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSystemMsgView

IMPLEMENT_DYNCREATE(CSystemMsgView, CView)

CSystemMsgView::CSystemMsgView()
{
}

CSystemMsgView::~CSystemMsgView()
{
}


BEGIN_MESSAGE_MAP(CSystemMsgView, CView)
	//{{AFX_MSG_MAP(CSystemMsgView)
	ON_WM_CREATE()
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSystemMsgView drawing

void CSystemMsgView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}

/////////////////////////////////////////////////////////////////////////////
// CSystemMsgView diagnostics

#ifdef _DEBUG
void CSystemMsgView::AssertValid() const
{
	CView::AssertValid();
}

void CSystemMsgView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CSystemMsgView message handlers

int CSystemMsgView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	RECT rect;
	memset(&rect, 0, sizeof(RECT));
	m_SystemMsg.Create(ES_LEFT|ES_MULTILINE|WS_VISIBLE,rect,this,0);

	CWnd*	pWnd	=&m_SystemMsg;
	SAFE_CHECKWND(pWnd)
	{
		COLORREF	clrBk	=RGB(150, 175, 230);
		m_SystemMsg.SetBackgroundColor(FALSE, clrBk);
		m_SystemMsg.SetReadOnly(TRUE);
		m_SystemMsg.AppendText("连接游戏完成...", RGB(125, 125, 125));
	}
	return 0;
}

void CSystemMsgView::OnSize(UINT nType, int cx, int cy) 
{
	CView::OnSize(nType, cx, cy);
	CWnd*	pWnd	=&m_SystemMsg;
	SAFE_CHECKWND(pWnd)
	{
		RECT	rect;
		memset(&rect, 0, sizeof(RECT));
		this->GetClientRect(&rect);
		m_SystemMsg.MoveWindow(&rect);
	}
	
}

⌨️ 快捷键说明

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