#if !defined(AFX_REMOTECHANNELDLG_H__8955FB02_F2C5_482F_AD01_B1D930E289CC__INCLUDED_)
#define AFX_REMOTECHANNELDLG_H__8955FB02_F2C5_482F_AD01_B1D930E289CC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RemoteChannelDlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CRemoteChannelDlg dialog


class CRemoteChannelDlg : public CDialog
{
// Construction

public:
	CRemoteChannelDlg(CWnd* pParent = NULL);   // 标准构造函数
	virtual ~CRemoteChannelDlg();
	// Dialog Data
	//{{AFX_DATA(CRemoteChannelDlg)
	enum { IDD = IDD_DLG_REMOTECHANNEL };
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
	virtual void OnOK();
	DECLARE_MESSAGE_MAP()
public:
	HANDLE m_hSearchHandle;
	virtual BOOL OnInitDialog();
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	static unsigned int SearchDevice(LPVOID parm);
private:
	BOOL InitWndShow();
	afx_msg void OnBnClickedButtonSearch();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnNMClickListSearchresult(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnDestroy();
	afx_msg void OnClose();
	afx_msg void OnNMKillfocusListSearchresult(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMSetfocusListSearchresult(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnCbnSelchangeComboProtocol();
public:
	void SetConfig(const NET_SDK_NetDecorderConfig_V4& config);
	bool GetOneCfg(NET_SDK_NetDecorderConfig_V4* netdcf);
	inline void SetConfNum(int num) {m_cur_confnum = num;}

	void	NetIPSearchDev();
	void	OnvifSearchDev();
public:
	int m_channel_number;
	int m_port;
	CString m_channel_name;
	CString m_ipaddr;
	CString m_username;
	CString m_userpwd;
	CString m_strDvrIP;
	CListCtrl m_listsearch_result;
	bool	m_buse_old;
	int m_lostfocus;
	int m_curporotocol;
	NET_SDK_NetDecorderConfig_V4  m_channel_configV4;
	NET_SDK_SEARCH_DEVINFO m_DeviceInfo[64];
	int					   m_DevicePro[64];
	int					m_searchLen;
	int					m_searchNum;
	int					m_cur_confnum;
	int  m_nhaveRtsp;
	UINT	m_nRemoteChannel;
	long	m_DevLoginID;
	afx_msg void OnLvnItemchangedListSearchresult(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedOk();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_REMOTECHANNELDLG_H__8955FB02_F2C5_482F_AD01_B1D930E289CC__INCLUDED_)
