⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myqqclientdlg.h

📁 实现了一个聊天系统的客户端
💻 H
字号:
// MyQQClientDlg.h : header file
//

#if !defined(AFX_MYQQCLIENTDLG_H__CC0D683A_CE13_4CDF_ADB4_82B7595CF4A6__INCLUDED_)
#define AFX_MYQQCLIENTDLG_H__CC0D683A_CE13_4CDF_ADB4_82B7595CF4A6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "AdvButton.h"
#include "ClientSocket.h"
#include "ContentMenu.h"
#include "ChatSocket.h"
#include <afxtempl.h>
/////////////////////////////////////////////////////////////////////////////
// CMyQQClientDlg dialog

struct SClientMsg
{
	UINT m_msgType;
	char m_msgBuff[2048];
};


struct SUserInfo
{
	UINT m_infoID;
	char m_infoNick[64];
	char m_infoName[64];
	UINT m_infoPSW;
	UINT m_infoAge;
	UINT m_infoSex;
	UINT m_infoPicture;
	UINT m_infoIsOnLine;
	UINT m_infoFriendList[64];
	UINT m_infoBlackList [64];
	char m_infoAddr[20];
	UINT m_infoPort;
	UINT m_infoTime;
	void * m_infoSocket;
};

class CMyQQClientDlg : public CDialog
{
// Construction
public:
	void ReadServerInfo();
	void RecvMsg();
	void SendMsg(int iSel);
	void AddFriend(UINT piUserID);
	void OnGetUserInfo(SUserInfo & info);
	void GetUserInfo(UINT piUserID);
	void OnLogInFinished();
	void LogIn();
	void OnServerClose();
	void OnRegisterFinished();
	void SetListEnable(BOOL pParam);
	void DownLoadList();
	void RegisterUserInfo();
	BOOL ConnectToServer();
	void OnReceive();
	CMyQQClientDlg(CWnd* pParent = NULL);	// standard constructor

	CClientSocket m_clientSocket;
	CChatSocket m_chatSocket;

	BOOL m_IsConnected;
	UINT m_IsRegister;
	UINT m_IsDownUserInfo;
	UINT m_iCount;

	SUserInfo m_userInfo;
	SClientMsg m_msg;
	CMenu * m_PopMenu;

	CList <SUserInfo,SUserInfo> m_lstFriend;

// Dialog Data
	//{{AFX_DATA(CMyQQClientDlg)
	enum { IDD = IDD_MYQQCLIENT_DIALOG };
	CAdvButton	m_btnStrangerList;
	CAdvButton	m_btnFriendList;
	CAdvButton	m_btnBlackList;
	CAdvButton	m_btnMenu;
	CAdvButton	m_btnMessage;
	CAdvButton	m_btnFind;
	//}}AFX_DATA
	CContentMenu	m_lstFriendListCtrl;
	CContentMenu	m_lstStrangerListCtrl;
	CContentMenu	m_lstBlackListCtrl;

	char serverAddr[20];
	UINT serverPort;

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyQQClientDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	void ChangeFolder(int piFolder);
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMyQQClientDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg void OnFind();
	afx_msg void OnMessage();
	afx_msg void OnFriendlistBtn();
	afx_msg void OnStrangerlistBtn();
	afx_msg void OnBlacklistBtn();
	afx_msg void OnMenu();
	afx_msg void OnSetserver();
	afx_msg void OnLogout();
	afx_msg void OnReviseinfo();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MYQQCLIENTDLG_H__CC0D683A_CE13_4CDF_ADB4_82B7595CF4A6__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -