#if !defined(AFX_BMPBTN_H__D8870468_E26F_45EA_B5CD_D583E620CC4D__INCLUDED_)
#define AFX_BMPBTN_H__D8870468_E26F_45EA_B5CD_D583E620CC4D__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CBmpBtn window

class CBmpBtn : public CButton
{
// Construction
public:
	CBmpBtn();

// Attributes
public:

	enum{	NORMAL	=0x0010,
		HOVER	=0x0020,
		HDOWN	=0x0030,
		DISABLE	=0x0040
		
	};
	CDC			m_memDC;//
	BOOL		m_bFirstDC;
	UINT		m_dwState;
	
	CBitmap		m_bmpNormal;
	CBitmap		m_bmpHover;
	CBitmap		m_bmpHdown;
	
	BOOL		m_bMouseOver;
	HCURSOR		m_hCurHandle;
	COLORREF	m_clrMask;//ÕÚÕÖÉ«
	HICON		m_hIcon;
	int			m_cxy;//µÈ´óÍ¼±ê
	COLORREF	m_crBorder;
	COLORREF	m_crFg;
	COLORREF	m_crBk;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBmpBtn)
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	void SetBmpNormal(UINT nBmpNormal);
	void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	void TransparentBlt1(CDC *pDC, CBitmap &Image,CRect &rect, COLORREF rgbMask);
	BOOL Create(LPCTSTR lpszText,DWORD dwStyle,const RECT &rect,CWnd* pWndparent,UINT nID,DWORD nFlag=NULL);
	void DrawButton();
	void SetBmp(UINT nBmpNormal,UINT nBmpHover,UINT nBmpHdown,COLORREF clrMask=NULL);
	void SetIcon(UINT nIcon,int ncxy);
	virtual ~CBmpBtn();

	// Generated message map functions
protected:
	//{{AFX_MSG(CBmpBtn)
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_BMPBTN_H__D8870468_E26F_45EA_B5CD_D583E620CC4D__INCLUDED_)
