- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
ChatEdit.cpp
资源名称:毕业论文--五子棋.zip [点击查看]
上传用户:fjjkzlh
上传日期:2010-04-06
资源大小:469k
文件大小:1k
源码类别:
棋牌游戏
开发平台:
Visual C++
- // ChatEdit.cpp : implementation file
- //
- #include "stdafx.h"
- #include "five.h"
- #include "ChatEdit.h"
- #include "Table.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CChatEdit
- CChatEdit::CChatEdit()
- {
- }
- CChatEdit::~CChatEdit()
- {
- }
- BEGIN_MESSAGE_MAP(CChatEdit, CEdit)
- //{{AFX_MSG_MAP(CChatEdit)
- ON_WM_KEYDOWN()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CChatEdit message handlers
- void CChatEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
- {
- // TODO: Add your message handler code here and/or call default
- if ( '6' == nChar )
- {
- CTable *pTable = (CTable *)( AfxGetMainWnd()->GetDlgItem( IDC_TABLE ) );
- // 发送聊天信息
- TCHAR str[128];
- GetWindowText( str, 128 );
- pTable->Chat( str );
- // 写入聊天记录
- CEdit *pEdit = (CEdit *)( AfxGetMainWnd()->GetDlgItem( IDC_EDT_CHAT ) );
- CString strAdd;
- strAdd.Format( _T("你 说:%srn"), str );
- pEdit->SetSel( -1, -1, TRUE );
- pEdit->ReplaceSel( str );
- SetWindowText( _T("") );
- }
- else
- {
- CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
- }
- }