• 大小: 3.65MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-31
  • 语言: C/C++
  • 标签: 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++开发的即时通讯系统\MyQQServer\CodePub.Com说明.txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

评论

共有 条评论