VC+++聊天室程序设计


VC++写的聊天室程序 实现了如下功能: 1. 用户注册账号 2. 用户注册时可以验证账号是否可用 3. 用户需要有效用户名和密码才能登陆服务器 4. 多人登陆到服务器同时聊天 5. 用户进入退出聊天室时其他的用户都得到通知 6. 服务器实时更新在线用户名单 7. 用户之间可以私聊 8. 支持抖动窗口的发送 9. 服务器可以踢出某个用户 10. 服务器可以关闭某个用户的计算机
资源截图
代码片段和文件信息
#include “stdafx.h“
#include “BtnST.h“

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

/////////////////////////////////////////////////////////////////////////////
// CButtonST

// Mask for control‘s type
#define BS_TYPEMASK SS_TYPEMASK

CButtonST::CButtonST()
{
m_bIsPressed = FALSE;
m_bIsFocused = FALSE;
m_bIsDisabled = FALSE;
m_bMouseOnButton = FALSE;

FreeResources(FALSE);

// Default type is “flat“ button
m_bIsFlat = TRUE;
// Button will be tracked also if when the window is inactive (like Internet Explorer)
m_bAlwaysTrack = TRUE;
  
// By default draw border in “flat“ button 
m_bDrawBorder = TRUE; 
  
// By default icon is aligned horizontally
m_byAlign = ST_ALIGN_HORIZ; 
  
// By default for “flat“ button don‘t draw the focus rect
m_bDrawFlatFocus = FALSE;

// By default the button is not the default button
m_bIsDefault = FALSE;
// Invalid value since type still unknown
m_nTypestyle = BS_TYPEMASK;

// By default the button is not a checkbox
m_bIsCheckBox = FALSE;
m_nCheck = 0;

// Set default colors
SetDefaultColors(FALSE);

// No tooltip created
m_ToolTip.m_hWnd = NULL;

// Do not draw as a transparent button
m_bDrawTransparent = FALSE;
m_pbmpOldBk = NULL;

// No URL defined
SetURL(NULL);

// No cursor defined
m_hCursor = NULL;

// No associated menu
#ifndef BTNST_USE_BCMENU
m_hMenu = NULL;
#endif
m_hParentWndMenu = NULL;
m_bMenuDisplayed = FALSE;

m_bShowDisabledBitmap = TRUE;
} // End of CButtonST

CButtonST::~CButtonST()
{
// Restore old bitmap (if any)
if (m_dcBk.m_hDC && m_pbmpOldBk)
{
m_dcBk.Selectobject(m_pbmpOldBk);
} // if

FreeResources();

// Destroy the cursor (if any)
if (m_hCursor) ::DestroyCursor(m_hCursor);

// Destroy the menu (if any)
#ifdef BTNST_USE_BCMENU
if (m_menuPopup.m_hMenu) m_menuPopup.DestroyMenu();
#else
if (m_hMenu) ::DestroyMenu(m_hMenu);
#endif
} // End of ~CButtonST

BEGIN_MESSAGE_MAP(CButtonST CButton)
    //{{AFX_MSG_MAP(CButtonST)
ON_WM_SETCURSOR()
ON_WM_KILLFOCUS()
ON_WM_MOUSEMOVE()
ON_WM_SYSCOLORCHANGE()
ON_CONTROL_REFLECT_EX(BN_CLICKED onclicked)
ON_WM_ACTIVATE()
ON_WM_ENABLE()
ON_WM_CANCELMODE()
ON_WM_GETDLGCODE()
ON_WM_CTLCOLOR_REFLECT()
//}}AFX_MSG_MAP
#ifdef BTNST_USE_BCMENU
ON_WM_MENUCHAR()
ON_WM_MEASUREITEM()
#endif

ON_MESSAGE(BM_SETstyle OnSetstyle)
ON_MESSAGE(WM_MOUSELEAVE onmouseleave)
ON_MESSAGE(BM_SETCHECK OnSetCheck)
ON_MESSAGE(BM_GETCHECK OnGetCheck)
END_MESSAGE_MAP()

void CButtonST::FreeResources(BOOL bCheckForNULL)
{
if (bCheckForNULL)
{
// Destroy icons
// Note: the following two lines MUST be here! even if
// BoundChecker says they are unnecessary!
if (m_csIcons[0].hIcon) ::DestroyIcon(m_csIcons[0].hIcon);
if (m_csIcons[1].hIcon) ::DestroyIcon(m_csIcons[1].hIcon);

// Destroy bitmaps
if (m_csBitmaps[0].hBitmap) :

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

     文件      52061  2002-04-17 18:34  VC+++聊天室程序设计ChatRoom2.0ClientBtnST.cpp

     文件       8400  2010-03-09 22:38  VC+++聊天室程序设计ChatRoom2.0ClientBtnST.h

     文件       3915  2010-04-02 20:05  VC+++聊天室程序设计ChatRoom2.0ClientBuffer.cpp

     文件        716  2010-04-02 19:59  VC+++聊天室程序设计ChatRoom2.0ClientBuffer.h

     文件      57088  2010-05-31 23:39  VC+++聊天室程序设计ChatRoom2.0ClientClient.aps

     文件       2469  2010-05-28 17:55  VC+++聊天室程序设计ChatRoom2.0ClientClient.cpp

     文件        589  2010-05-28 15:57  VC+++聊天室程序设计ChatRoom2.0ClientClient.h

     文件       9600  2010-05-31 23:39  VC+++聊天室程序设计ChatRoom2.0ClientClient.rc

     文件       2560  2010-05-04 13:20  VC+++聊天室程序设计ChatRoom2.0ClientClient.suo

     文件       7317  2010-04-09 19:42  VC+++聊天室程序设计ChatRoom2.0ClientClient.vcproj

     文件       1417  2010-04-15 23:43  VC+++聊天室程序设计ChatRoom2.0ClientClient.vcproj.Walking-PC.Walking.user

     文件       8998  2010-05-29 23:10  VC+++聊天室程序设计ChatRoom2.0ClientClient.vcxproj

     文件       4563  2010-05-29 23:10  VC+++聊天室程序设计ChatRoom2.0ClientClient.vcxproj.filters

     文件        143  2010-04-18 21:32  VC+++聊天室程序设计ChatRoom2.0ClientClient.vcxproj.user

     文件      17268  2010-05-29 22:32  VC+++聊天室程序设计ChatRoom2.0ClientClientDlg.cpp

     文件       1692  2010-05-29 22:38  VC+++聊天室程序设计ChatRoom2.0ClientClientDlg.h

     文件       4592  2010-05-30 16:11  VC+++聊天室程序设计ChatRoom2.0ClientCLientMsg.cpp

     文件        609  2010-05-30 16:11  VC+++聊天室程序设计ChatRoom2.0ClientCLientMsg.h

     文件       1487  2010-05-30 16:23  VC+++聊天室程序设计ChatRoom2.0ClientClientSocket.cpp

     文件        243  2010-05-30 07:59  VC+++聊天室程序设计ChatRoom2.0ClientClientSocket.h

     文件       1297  2010-04-04 15:43  VC+++聊天室程序设计ChatRoom2.0ClientConnectDlg.cpp

     文件        612  2010-04-04 15:43  VC+++聊天室程序设计ChatRoom2.0ClientConnectDlg.h

     文件       6969  2010-06-06 10:52  VC+++聊天室程序设计ChatRoom2.0ClientHandleMsg.cpp

     文件       1597  2010-06-01 11:51  VC+++聊天室程序设计ChatRoom2.0ClientHandleMsg.h

     文件       2996  2010-05-30 08:55  VC+++聊天室程序设计ChatRoom2.0ClientLoginDlg.cpp

     文件        765  2010-05-29 23:31  VC+++聊天室程序设计ChatRoom2.0ClientLoginDlg.h

     文件       2853  2010-05-28 17:51  VC+++聊天室程序设计ChatRoom2.0ClientMsgFactory.cpp

     文件       1281  2010-05-30 16:11  VC+++聊天室程序设计ChatRoom2.0ClientMsgFactory.h

     文件       2851  2010-04-03 12:38  VC+++聊天室程序设计ChatRoom2.0ClientReadMe.txt

     文件       4966  2010-05-31 23:13  VC+++聊天室程序设计ChatRoom2.0ClientRegister.cpp

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

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

发表评论

评论列表(条)