#ifndef _CMDMGR_H_
#define _CMDMGR_H_

#define FLAG_PACK "cmd"
typedef struct
{
	char flag[4];
	short id;
	short size_pack;

}CMD_PACK_HDR;

typedef struct
{
	HWND hWnd;
	void* buf;
}CMD_OBJ;
#define PORT_CMDSOCK  1159
class CCmdMgr
{
public:
	void CleanUp();
	BOOL SendCmd(HWND hWnd,void* buf,UINT len,char* dst,int port,bool rp=true);
	BOOL Init();
	virtual  ~CCmdMgr();
	CCmdMgr();
	friend DWORD WINAPI CmdMgrThreadProc(LPVOID lpParameter);
protected:
	DWORD m_dwThreadId;
	HANDLE m_hThread;
	HANDLE m_hEvent;
	
};
class CMsgRcvWnd:public CWndX
{
public:
	CMsgRcvWnd();
	virtual ~CMsgRcvWnd();
	BOOL Create();
protected:
	short m_id;
	LRESULT WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
};
class CCmdSocket:public CUDPSocket
{
public:
	
	virtual  ~CCmdSocket();
	CCmdSocket();
};


#endif