📄 curwin.cpp
字号:
// Curwin.cpp : implementation file
//
#include "stdafx.h"
#include "newclient.h"
#include "Curwin.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCurwin dialog
extern HBRUSH hBrush;
extern CLIENTPARAM ClientParam;
CCurwin::CCurwin(CWnd* pParent /*=NULL*/)
: CDialog(CCurwin::IDD, pParent)
{
//{{AFX_DATA_INIT(CCurwin)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCurwin::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCurwin)
DDX_Control(pDX, IDC_BLACK, m_black);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCurwin, CDialog)
//{{AFX_MSG_MAP(CCurwin)
ON_WM_CREATE()
ON_WM_MOVE()
ON_WM_PAINT()
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCurwin message handlers
int CCurwin::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
return 0;
}
void CCurwin::OnMove(int x, int y)
{
CDialog::OnMove(x, y);
// TODO: Add your message handler code here
}
void CCurwin::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect rcBounds;
GetClientRect(&rcBounds);
CPen penWhite;
penWhite.CreatePen(PS_SOLID, 1, RGB(0,255,0));
CPen* pOldPen = dc.SelectObject(&penWhite);
dc.MoveTo(rcBounds.left, rcBounds.top);
dc.LineTo(rcBounds.right-1,rcBounds.top);
dc.LineTo(rcBounds.right-1,rcBounds.bottom-1);
dc.LineTo(rcBounds.left, rcBounds.bottom-1);
dc.LineTo(rcBounds.left, rcBounds.top);
dc.SelectObject(pOldPen);
m_black.MoveWindow(rcBounds.left+1,rcBounds.top+1,rcBounds.Width()-2,rcBounds.Height()-2);
}
HBRUSH CCurwin::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(ClientParam.m_bUseCard)
{
return hBrush;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -