📄 apithread.h
字号:
#if !defined(AFX_APITHREAD_H__DECAB183_78D1_11D3_8AB6_5254AB104A0B__INCLUDED_)
#define AFX_APITHREAD_H__DECAB183_78D1_11D3_8AB6_5254AB104A0B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ApiThread.h : header file
//
#include "ApiWnd.h"
#define WM_API_CONNECT (WM_USER + 0x100)
#define WM_API_DISCONNECT (WM_USER + 0x101)
#define WM_API_COMMAND (WM_USER + 0x102)
#define WM_API_DATA (WM_USER + 0x103)
#define WM_API_DATA_RESPONSE (WM_USER + 0x104)
/////////////////////////////////////////////////////////////////////////////
// CApiThread thread
class CApiThread : public CWinThread
{
DECLARE_DYNCREATE(CApiThread)
public:
//protected:
CApiThread(); // protected constructor used by dynamic creation
void operator delete(void* p);
BOOL IsConnected();
int GetDataValue();
BYTE * GetData(int & iLength);
// Attributes
public:
static HANDLE m_hEventThreadKilled;
static HANDLE m_hEventThreadCreated;
static HANDLE m_hEventProtocol;
static void PrepareEvent();
static void UnprepareEvent();
protected:
CApiWnd m_wndApi;
int m_iConnectType;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CApiThread)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CApiThread();
// Generated message map functions
//{{AFX_MSG(CApiThread)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
afx_msg void OnConnect(WPARAM wParam, LPARAM lParam);
afx_msg void OnDisconnect(WPARAM wParam = 0, LPARAM lParam = 0);
afx_msg void OnCommand(WPARAM wParam, LPARAM lParam);
afx_msg void OnData(WPARAM wParam, LPARAM lParam);
afx_msg void OnDataResponse(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_APITHREAD_H__DECAB183_78D1_11D3_8AB6_5254AB104A0B__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -