#pragma once
#include <GdiPlus.h>

using namespace Gdiplus;
// HKCardDlg dialog

class HKCardDlg : public CDialog
{
	DECLARE_DYNAMIC(HKCardDlg)

public:
	HKCardDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~HKCardDlg();

// Dialog Data
	enum { IDD = IDD_HKCARDDLG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()


public:
	afx_msg void OnBnClickedReadIdHkcard();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg void OnPaint();
	virtual BOOL OnInitDialog();

	void SetReadParam(int nPort, int nTimer, int nRepeat);


	CStatic m_HKName;
	CStatic m_HKSex;
	CStatic m_HKBirthday;
	CStatic m_PassCheckID;
	CStatic m_IssuesNum;
	CStatic m_HKCardID;
	CStatic m_HKAddress;
	CStatic m_HKDepartment;
	CStatic m_HKValidDate;
	CStatic m_HKSamID;
	CStatic m_HKReadTime;
	CStatic m_HKCardType;
	CStatic m_HKFPBuf;

	Bitmap * m_pBmp;
	UINT_PTR m_nTimerEvent;

	int m_nPort;
	int m_nTimer;
	BOOL m_nRepeat;
	BOOL m_bParamChanged;

	void OnLoadCivicPic();
	void ShowPhoto(int nPhotoID);

	void ReadCard();
	CString GetFPbuf(void);
	CString GetFPcode(int FPcode); 
};
