From 1b143a693692191ad7dd85ea30fd64515964a0c2 Mon Sep 17 00:00:00 2001 From: mjjo Date: Sat, 20 Jul 2013 23:23:10 +0000 Subject: [PATCH] --- HookMsg/TickerSocket.h | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 HookMsg/TickerSocket.h diff --git a/HookMsg/TickerSocket.h b/HookMsg/TickerSocket.h new file mode 100644 index 0000000..b59ba60 --- /dev/null +++ b/HookMsg/TickerSocket.h @@ -0,0 +1,66 @@ +#if !defined(AFX_TICKERSOCKET_H__2A49E7C6_67E3_11D3_8401_006097663D30__INCLUDED_) +#define AFX_TICKERSOCKET_H__2A49E7C6_67E3_11D3_8401_006097663D30__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +// TickerSocket.h : header file +// + + +///////////////////////////////////////////////////////////////////////////// +// Client ¼ÒÄÏ Event +#define SCM_CLOSE WM_USER+2 // Client ¼ÒÄÏ ÇØÁ¦ +#define SCM_RECEIVE WM_USER+3 // Client·Î ºÎÅÍ ¼ö½ÅµÇ´Â µ¥ÀÌÅÍ +///////////////////////////////////////////////////////////////////////////// +// ON_MESSAGE(SCM_CLOSE, OnClientClose) // Client ¼ÒÄÏ ÇØÁ¦ +// ON_MESSAGE(SCM_RECEIVE, OnClientReceive) // Client·Î ºÎÅÍ ¼ö½ÅµÇ´Â µ¥ÀÌÅÍ +// afx_msg LRESULT OnClientClose(WPARAM wParam, LPARAM lClient); // Client ¼ÒÄÏ ÇØÁ¦ +// afx_msg LRESULT OnClientReceive(WPARAM wParam, LPARAM lClient); // Client·Î ºÎÅÍ ¼ö½ÅµÇ´Â µ¥ÀÌÅÍ + +///////////////////////////////////////////////////////////////////////////// +// CTickerSocket command target + +#define MAX_RECEIVE_LEN 4096 + +class CTickerSocket : public CSocket +{ +// Attributes +public: + +// Operations +public: + CTickerSocket(); + virtual ~CTickerSocket(); + + BOOL Create(LPSTR szAddress, UINT nPortNo, CWnd* pParentWnd, int nReceiveDataSize=MAX_RECEIVE_LEN); + +// Overrides +public: + BYTE* m_byteReceive; // ¼ö½Å ¹öÆÛ + int m_nReceiveLen; // ¼ö½Å µ¥ÀÌÅÍ ±æÀÌ + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CTickerSocket) + public: + virtual void OnReceive(int nErrorCode); + virtual void OnClose(int nErrorCode); + //}}AFX_VIRTUAL + + // Generated message map functions + //{{AFX_MSG(CTickerSocket) + // NOTE - the ClassWizard will add and remove member functions here. + //}}AFX_MSG + +// Implementation +protected: + int m_nReceiveSize; // ¼ö½Å µ¥ÀÌÅÍÀÇ ÃÖ´ë ±æÀÌ + CWnd* m_wndParent; // Parent À©µµ¿ì +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_TICKERSOCKET_H__2A49E7C6_67E3_11D3_8401_006097663D30__INCLUDED_)