DlgChatLog.cpp
资源名称:ROA3.40.rar [点击查看]
上传用户:tianheyiqi
上传日期:2010-04-16
资源大小:282k
文件大小:2k
源码类别:
外挂编程
开发平台:
Visual C++
- // DlgChatLog.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ROA.h"
- #include "DlgChatLog.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDlgChatLog dialog
- CDlgChatLog::CDlgChatLog(CWnd* pParent /*=NULL*/)
- : CDialog(CDlgChatLog::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CDlgChatLog)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void CDlgChatLog::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDlgChatLog)
- DDX_Control(pDX, IDC_EDT_CHATMSG, m_edtChatMsg);
- DDX_Control(pDX, IDC_CMB_CHATTO, m_cmbChatTo);
- DDX_Control(pDX, IDC_LST_CHAT, m_lstChatLog);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CDlgChatLog, CDialog)
- //{{AFX_MSG_MAP(CDlgChatLog)
- ON_WM_SIZE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDlgChatLog message handlers
- BOOL CDlgChatLog::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- m_lstChatLog.InsertColumn( 0, _T("Time"), LVCFMT_LEFT, 50 );
- m_lstChatLog.InsertColumn( 1, _T("From"), LVCFMT_LEFT, 50 );
- m_lstChatLog.InsertColumn( 2, _T("Message"), LVCFMT_LEFT, 50 );
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CDlgChatLog::OnSize(UINT nType, int cx, int cy)
- {
- if(SIZE_RESTORED == nType && ::IsWindow(m_lstChatLog.m_hWnd))
- {
- CRect rect;
- int x, y;
- GetClientRect(rect);
- if(cx < 100)
- cx = 100;
- if(cy < 30)
- cy = 30;
- x = rect.right;
- y = rect.bottom;
- rect.bottom -= 26;
- m_lstChatLog.SetWindowPos(&wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER);
- rect.top = rect.bottom + 4;
- rect.bottom = y+50;
- rect.right = rect.left + 80;
- m_cmbChatTo.SetWindowPos(&wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER);
- rect.left = rect.right + 4;
- rect.right = x;
- rect.bottom = y-2;
- m_edtChatMsg.SetWindowPos(&wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER);
- }
- CDialog::OnSize(nType, cx, cy);
- }