myscreensvrwnd.cpp

来自「"Visual C++.net实践与提高-深入Windows编程"的源代码」· C++ 代码 · 共 47 行

CPP
47
字号
// MyScreenSvrWnd.cpp : implementation file
//

#include "stdafx.h"
#include "MyScreenSvr.h"
#include "MyScreenSvrWnd.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyScreenSvrWnd

CMyScreenSvrWnd::CMyScreenSvrWnd(CWnd* pwnd /*= NULL*/)
:CScreenSvrWnd(pwnd)
{
}

CMyScreenSvrWnd::~CMyScreenSvrWnd()
{
}


BEGIN_MESSAGE_MAP(CMyScreenSvrWnd, CScreenSvrWnd)
	//{{AFX_MSG_MAP(CMyScreenSvrWnd)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMyScreenSvrWnd message handlers

void CMyScreenSvrWnd::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	CRect rect ;
	GetWindowRect(&rect) ;
	CSize size = dc.GetOutputTextExtent("Produced By MYH!") ;
	dc.SetTextColor(RGB(255,255,255)) ;
	dc.SetBkColor(RGB(0,0,0)) ;
	dc.TextOut(rect.Width()-size.cx,rect.Height()-size.cy,"Produced by MYH!") ;
}

⌨️ 快捷键说明

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