ClientDlg.cpp
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:2k
- // ClientDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "Billiards.h"
- #include "ClientDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CClientDlg dialog
- CClientDlg::CClientDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CClientDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CClientDlg)
- m_strAddress = _T("10.14.13.197");
- m_strNickname = _T("");
- m_WhiteBrush=new CBrush(HS_CROSS,RGB(255,255,255));
- m_BlueBrush=new CBrush(HS_CROSS,RGB(200,200,255));
- //}}AFX_DATA_INIT
- }
- void CClientDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CClientDlg)
- DDX_Text(pDX, IDC_EDIT_ADDRESS, m_strAddress);
- DDX_Text(pDX, IDC_EDIT_NICKNAME, m_strNickname);
- DDX_Control(pDX, IDOK, m_BtnOK);
- DDX_Control(pDX, IDCANCEL, m_BtnCANCEL);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CClientDlg, CDialog)
- //{{AFX_MSG_MAP(CClientDlg)
- ON_WM_CTLCOLOR()
-
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- BOOL CClientDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- return TRUE;
- }
- HBRUSH CClientDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
-
- if(nCtlColor==CTLCOLOR_DLG||nCtlColor==CTLCOLOR_STATIC){
- pDC->SetBkColor(RGB(255,255,255));
- return (HBRUSH)(m_WhiteBrush->GetSafeHandle());
- }
- if(nCtlColor==CTLCOLOR_EDIT){
- pDC->SetBkColor(RGB(200,200,255));
- return (HBRUSH)(m_BlueBrush->GetSafeHandle());
- }
- return hbr;
- }