ClientDlg.cpp
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:2k
源码类别:

游戏

开发平台:

Visual C++

  1. // ClientDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "Billiards.h"
  5. #include "ClientDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CClientDlg dialog
  13. CClientDlg::CClientDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CClientDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CClientDlg)
  17. m_strAddress = _T("10.14.13.197");
  18. m_strNickname = _T("");
  19. m_WhiteBrush=new CBrush(HS_CROSS,RGB(255,255,255));
  20. m_BlueBrush=new CBrush(HS_CROSS,RGB(200,200,255));
  21. //}}AFX_DATA_INIT
  22. }
  23. void CClientDlg::DoDataExchange(CDataExchange* pDX)
  24. {
  25. CDialog::DoDataExchange(pDX);
  26. //{{AFX_DATA_MAP(CClientDlg)
  27. DDX_Text(pDX, IDC_EDIT_ADDRESS, m_strAddress);
  28. DDX_Text(pDX, IDC_EDIT_NICKNAME, m_strNickname);
  29. DDX_Control(pDX, IDOK, m_BtnOK);
  30. DDX_Control(pDX, IDCANCEL, m_BtnCANCEL);
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(CClientDlg, CDialog)
  34. //{{AFX_MSG_MAP(CClientDlg)
  35. ON_WM_CTLCOLOR()
  36.     
  37. //}}AFX_MSG_MAP
  38. END_MESSAGE_MAP()
  39. BOOL CClientDlg::OnInitDialog() 
  40. {
  41. CDialog::OnInitDialog();
  42. return TRUE;  
  43. }
  44. HBRUSH CClientDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
  45. {
  46. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  47.     if(nCtlColor==CTLCOLOR_DLG||nCtlColor==CTLCOLOR_STATIC){
  48.         pDC->SetBkColor(RGB(255,255,255));
  49.         return (HBRUSH)(m_WhiteBrush->GetSafeHandle());
  50.     }
  51. if(nCtlColor==CTLCOLOR_EDIT){
  52. pDC->SetBkColor(RGB(200,200,255));
  53.         return (HBRUSH)(m_BlueBrush->GetSafeHandle());
  54. }
  55. return hbr;
  56. }