Visual C++ 开发的即时通讯系统


Visual C++ 开发的类似 QQ 的即时通讯系统,典型的C/S结构,是学习和从事这方面开发的较好参考材料。
资源截图
代码片段和文件信息
// AdvButton.cpp : implementation file
//

#include “stdafx.h“
#include “MyQQClient.h“
#include “AdvButton.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#define MAXCAPTIONLEN 64
/////////////////////////////////////////////////////////////////////////////
// CAdvButton

CAdvButton::CAdvButton()
{
//initialize member variable
m_ClientRect.left  = 0;
m_ClientRect.top   = 0;
m_ClientRect.right = 0;
m_ClientRect.bottom= 0;

m_ClientRgn.Deleteobject();
m_ClientRgn.CreateEllipticRgnIndirect(&m_ClientRect);

m_State = 0;
m_Point.x = m_Point.y = 0;
m_IsTimerOn = FALSE;
m_BtnType = 0;

m_iPicture = 0;
}

CAdvButton::~CAdvButton()
{
}

BEGIN_MESSAGE_MAP(CAdvButton CButton)
//{{AFX_MSG_MAP(CAdvButton)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_TIMER()
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAdvButton message handlers

BOOL CAdvButton::Create(LPCTSTR lpszCaptionDWORD dwstyleconst RECT& rectCWnd *pParentWndUINT nID)
{
return CButton::Create(lpszCaption dwstyle rect pParentWnd nID);
}

void CAdvButton::PreSubclassWindow() 
{
//modify style
Modifystyle(0 BS_OWNERDRAW|BS_PUSHBUTTON);

CButton::PreSubclassWindow();
}

int CAdvButton::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
if (CButton::OnCreate(lpCreateStruct) == -1)
return -1;

return 0;
}

void CAdvButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
{
//get client rect
GetClientRect(&m_ClientRect);
// m_ClientRgn.Deleteobject();
// m_ClientRgn.CreateEllipticRgnIndirect(&m_ClientRect);

CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);

if ( m_BtnType == 0) {
switch (m_State)
{
case 0:
pDC->FillRect(&m_ClientRectnew CBrush(RGB(225225255)));
break;
case 1:
pDC->FillRect(&m_ClientRectnew CBrush(RGB(192192255)));
break;
case 2:
pDC->FillRect(&m_ClientRectnew CBrush(RGB(225225255)));
break;
case 3:
pDC->FillRect(&m_ClientRectnew CBrush(RGB(128128255)));
break;
}
LPTSTR pCaption = new char[MAXCAPTIONLEN]; //
int iLen = GetWindowText(pCaptionMAXCAPTIONLEN);
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(TextColor);
pDC->DrawText(pCaptioniLen&m_ClientRectDT_SINGLELINE|DT_CENTER|DT_VCENTER);
}
else if ( m_BtnType == 1 ) {
pDC->FillRect(&m_ClientRectnew CBrush(RGB(192192255)));

LPTSTR pCaption = new char[MAXCAPTIONLEN]; //
int iLen = GetWindowText(pCaptionMAXCAPTIONLEN);
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(TextColor);
pDC->DrawText(pCaptioniLen&m_ClientRectDT_SINGLELINE|DT_CENTER|DT_VCENTER);
}
else if ( m_BtnType == 2 ) {
CDC dcMemory;
CBitmap* pOldBmp = new CBitmap;
pOldBmp->LoadBitmap(m_iPicture+IDB_BITMAP1);

dcMemory.CreateCompatibleDC(pDC);
pOldBmp = dcMemory.SelectObje

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1468  2009-05-20 20:34  VisualC++开发的即时通讯系统MyQQServerCodePub.Com说明.txt

     文件       1716  2009-06-04 20:04  VisualC++开发的即时通讯系统MyQQServer
ead me.txt

     文件       1721  2009-06-04 20:04  VisualC++开发的即时通讯系统MyQQClient
ead me.txt

     文件       3651  2004-11-01 16:23  VisualC++开发的即时通讯系统MyQQClientMyQQClientReadMe.txt

     文件       3651  2004-11-06 15:09  VisualC++开发的即时通讯系统MyQQServerMyQQServerReadMe.txt

     文件       2088  2006-05-18 11:07  VisualC++开发的即时通讯系统MyQQServerMyQQServerDebugUserInfo.txt

     文件       3324  2006-05-18 10:06  VisualC++开发的即时通讯系统MyQQServerMyQQServerDebugBuildLog.htm

     文件       1944  2004-11-13 12:32  VisualC++开发的即时通讯系统MyQQClientMyQQClientAdvButton.h

     文件       1307  2004-11-15 15:33  VisualC++开发的即时通讯系统MyQQClientMyQQClientChatSocket.h

     文件       1288  2004-11-07 00:04  VisualC++开发的即时通讯系统MyQQClientMyQQClientClientSocket.h

     文件       1374  2004-11-12 08:55  VisualC++开发的即时通讯系统MyQQServerMyQQServerClientSocket.h

     文件       2269  2004-11-15 14:57  VisualC++开发的即时通讯系统MyQQClientMyQQClientContentmenu.h

     文件       1328  2004-11-15 12:17  VisualC++开发的即时通讯系统MyQQClientMyQQClientFindDlg.h

     文件       1321  2004-11-12 08:54  VisualC++开发的即时通讯系统MyQQServerMyQQServerListenSocket.h

     文件       1587  2004-11-10 18:51  VisualC++开发的即时通讯系统MyQQClientMyQQClientLoginDlg.h

     文件       1368  2004-11-01 16:23  VisualC++开发的即时通讯系统MyQQClientMyQQClientMyQQClient.h

     文件       3142  2004-11-15 16:42  VisualC++开发的即时通讯系统MyQQClientMyQQClientMyQQClientDlg.h

     文件       1368  2004-11-06 15:09  VisualC++开发的即时通讯系统MyQQServerMyQQServerMyQQServer.h

     文件       2883  2004-11-15 11:10  VisualC++开发的即时通讯系统MyQQServerMyQQServerMyQQServerDlg.h

     文件       1854  2004-11-15 12:28  VisualC++开发的即时通讯系统MyQQClientMyQQClientRegisterDlg.h

     文件       1331  2004-11-12 09:09  VisualC++开发的即时通讯系统MyQQServerMyQQServer
esource.h

     文件       3484  2004-11-13 17:08  VisualC++开发的即时通讯系统MyQQClientMyQQClient
esource.h

     文件       1611  2004-11-15 15:46  VisualC++开发的即时通讯系统MyQQClientMyQQClientSendRecvDlg.h

     文件       1504  2004-11-15 17:16  VisualC++开发的即时通讯系统MyQQClientMyQQClientSetServerDlg.h

     文件       1102  2004-11-01 16:23  VisualC++开发的即时通讯系统MyQQClientMyQQClientStdAfx.h

     文件       1102  2004-11-06 15:09  VisualC++开发的即时通讯系统MyQQServerMyQQServerStdAfx.h

     文件       4776  2004-11-13 23:50  VisualC++开发的即时通讯系统MyQQClientMyQQClientAdvButton.cpp

     文件        933  2004-11-15 15:34  VisualC++开发的即时通讯系统MyQQClientMyQQClientChatSocket.cpp

     文件       1046  2004-11-06 17:40  VisualC++开发的即时通讯系统MyQQClientMyQQClientClientSocket.cpp

     文件       1291  2004-11-12 08:56  VisualC++开发的即时通讯系统MyQQServerMyQQServerClientSocket.cpp

............此处省略68个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)