?? ipcclient.h
字號:
#if !defined(AFX_IPCCLIENT_H__B21E172B_AD88_480B_8B11_0EFDF78405B0__INCLUDED_)
#define AFX_IPCCLIENT_H__B21E172B_AD88_480B_8B11_0EFDF78405B0__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// IPCClient.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CIPCClient window
//定義消息常量
const LPCTSTR IPCServerDisconnecting = _T("IPCServerDisconnecting");//當服務器斷開連接時
const LPCTSTR IPCClientDisconnecting = _T("IPCClientDisconnecting");//當客戶端斷開連接時
const LPCTSTR IPCConnectRequest = _T("IPCConnectRequest");//當客戶端連接請求時
const LPCTSTR IPCConnectRespose = _T("IPCConnectRespose");//當客戶端連接響應時
//客戶端連接事件
typedef void (CALLBACK* ONCLIENTCONNECTED)(CWnd*,HWND);
//客戶端斷開事件
typedef void (CALLBACK* ONCLIENTDISCONNECTED)(CWnd*,HWND);
//客戶端接收數據事件
typedef void (CALLBACK* ONCLIENTDATAARRIVE)(CWnd*,LPVOID,DWORD);
class CIPCClient : public CWnd
{
// Construction
public:
CIPCClient();
// Attributes
public:
LPCTSTR m_SessionName; // 連接會話的名字
ONCLIENTCONNECTED m_ClientConnected; //客戶端連接事件
ONCLIENTDISCONNECTED m_ClientDisConnected; //客戶端斷開連接事件
ONCLIENTDATAARRIVE m_ClientDataArrive; //客戶端接收數據事件
//同服務器建立連接
void Open(CWnd *parentWnd);
//關閉同服務器連接
void Close(void);
//發送數據
void SendMsg(LPVOID MsgPointer, DWORD ASize);
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CIPCClient)
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CIPCClient();
// Generated message map functions
protected:
//{{AFX_MSG(CIPCClient)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
HWND m_ServerWinHwnd; //服務端窗體句柄
CWnd* m_ParentWnd; ////指定創建此組件的窗體指針
bool m_Active; //是否激活
DWORD m_SessionHandle; //連接會話的消息標識符
DWORD m_ServerDisconnectHwnd; //IPCServerDisconnecting消息標識符
DWORD m_ConnectRequestHwnd; //IPCConnectRequest消息標識符
DWORD m_ConnectResposeHwnd; //IPCConnectRespose消息標識符
DWORD m_ClientDisconnectHwnd; //IPCClientDisconnecting消息標識符
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IPCCLIENT_H__B21E172B_AD88_480B_8B11_0EFDF78405B0__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -