?? clientprogramdlg.h
字號:
// ClientProgramDlg.h : header file
// Copyright (c) 2002
//
// Written by: Jeff Miles
// Email: jeffmiles99@hotmail.com
//
// Thank you to both Adam Clauss for his IniFile class, and
// Chris Maunder and Warren Young for their System Tray work.
//
// This program is the Client portion to a complete
// Client/Server framework. Feel free to use this framework
// as the basis for your network application. If you do use
// this framework, please let me know via e-mail.
//
// Since this program has not been extensively tested, expect bugs.
// Please e-mail me any suggestions or bugs that you find, or better
// yet, any modifications that you have made that adds to this programs
// functionality or efficiency.
//
// ***THIS VERSION FIXED THE FOLLOWING TWO BUGS IN VERSION 1.0***
// Known Bug: The Server Program does not compile in Debug mode.
// Use Release mode instead.
//
// Known Bug: The Server Program's Exit button does not function correctly.
// Use the "Shut Down Server" button instead.
//
#if !defined(AFX_CLIENTPROGRAMDLG_H__F86F5F7A_55E6_41AA_9A38_81F43FBC4789__INCLUDED_)
#define AFX_CLIENTPROGRAMDLG_H__F86F5F7A_55E6_41AA_9A38_81F43FBC4789__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Socket.h"
#define WM_RECEIVE_MESSAGE (WM_USER +1)
#define WM_DISCONNECT (WM_USER +2)
/////////////////////////////////////////////////////////////////////////////
// CClientProgramDlg dialog
class CClientProgramDlg : public CDialog
{
// Construction
public:
//Variables
CListCtrl userList;
CFile destFile;
CString destFileMem;
CString version;
CString name;
CString password;
CString IP;
bool endServer;
int nextSocketAvail;
Socket Sock;
int nPort;
//Functions
void GiveMessage(CString message);
void SendUserMessage(CString message, int nSock);
void SendAllUsersMessage(CString message);
void SendAllUsersMessageExceptForOne(CString message, int nSock);
void SendServerMessage(CString message);
LRESULT OnReceiveMessage(WPARAM receiveMessage,LPARAM);
LRESULT OnDisconnect(WPARAM,LPARAM);
void MessageReceive(CString newMessage);
CString ParseMessage(CString message, int nSlot);
CClientProgramDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CClientProgramDlg)
enum { IDD = IDD_CLIENTPROGRAM_DIALOG };
CString m_Name;
CString m_IP;
CString m_Port;
CString m_Password;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CClientProgramDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CClientProgramDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg void ConnectToServer();
afx_msg HCURSOR OnQueryDragIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CLIENTPROGRAMDLG_H__F86F5F7A_55E6_41AA_9A38_81F43FBC4789__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -