// VIBFinderDlg.h : header file
//

#include "iVIBBox.h"
#include "VIBBox.h"
#include "FlashBox.h"

#pragma once

#define MAX_DEV 10

#define IDM_TSKREADY (WM_USER+1)

// CVIBFinderDlg dialog
class CVIBFinderDlg : public CDialog
{
// Construction
public:
	CVIBFinderDlg(CWnd* pParent = NULL);	// standard constructor
	static DWORD WINAPI TskReceiveUDP(LPVOID pParam);

// Dialog Data
	enum { IDD = IDD_VIBFINDER_DIALOG };

// Implementation
protected:
	void OnCancel();

	char *m_pTcpDisplayFileName;
	HICON m_hIcon;
	CEdit* m_pReceive;
	SOCKET m_sSocketUdp;	//!< UDP socket
	HANDLE m_hReceiveThread;//!< Handle UDP Broadcast-Thread
	DWORD  m_dwThreadID;	//!< Thread-ID Read-Thread
	bool m_bSendFlag;		//!< UDP has send
	bool m_ChangeCursor;	//!< darf der MausZeiger verändert werden
	
	vector<iVIBBox*>m_DeviceList;		//!< Liste der Boxen

	void ClearDeviceList();
	BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);

	// Generated message map functions
	LRESULT OnReadyTsk(WPARAM wParam, LPARAM lParam);
	virtual BOOL OnInitDialog();
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBnClickedFinddev();
	afx_msg void OnDblClkDevList(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedOpendev();
	DECLARE_MESSAGE_MAP()
public:
	static int CVIBFinderDlg::GetVersion(char ProgrammVersion[128]);
};
