// Curwin.cpp : implementation file // #include "stdafx.h" #include "newclient.h" #include "Curwin.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 ON_STN_CLICKED(IDC_BLACK, OnStnClickedBlack) 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; } void CCurwin::OnStnClickedBlack() { // TODO: 在此添加控件通知处理程序代码 }