page.cpp
来自「开发环境为EVC」· C++ 代码 · 共 71 行
CPP
71 行
// Page.cpp : implementation file
//
#include "stdafx.h"
#include "TestDoc.h"
#include "Page.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPage dialog
CPage::CPage(CWnd* pParent /*=NULL*/)
: CDialog(CPage::IDD, pParent)
{
//{{AFX_DATA_INIT(CPage)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CPage::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPage)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPage, CDialog)
//{{AFX_MSG_MAP(CPage)
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPage message handlers
void CPage::OnMouseMove(UINT nFlags, CPoint lParam)
{
CDC* dc;
dc = this->GetDC();
// Create and select a solid blue brush.
CBrush brushBlue;
brushBlue.CreateSolidBrush(RGB(0, 0, 255));
CBrush* pOldBrush = dc->SelectObject(&brushBlue);
// Create and select a thick, black pen.
CPen penBlack;
penBlack.CreatePen(PS_SOLID, 3, RGB(0, 0, 0));
CPen* pOldPen = dc->SelectObject(&penBlack);
// Get the client rectangle.
CRect rect;
GetClientRect(rect);
// Shrink the rectangle 20 pixels in each direction.
rect.DeflateRect(20, 20);
// Draw a thick black rectangle filled with blue.
dc->Rectangle(rect);
dc->DeleteDC();
//free(dc);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?