www.pudn.com > MFCVista.rar > IMsgBox.h


#pragma once 
#include "afxwin.h" 
#include "stdafx.h" 
#include "IBitmapButton.h" 
#include  
class AFX_EXT_CLASS CIMsgBox : public CDialog,public CIontrlPos 
{ 
private: 
	DECLARE_MESSAGE_MAP() 
	DECLARE_DYNAMIC(CIMsgBox) 
public: 
	CIMsgBox(CWnd *pParent=NULL);   // 标准构造函数 
	CIMsgBox(UINT nIDDlg,CWnd *pParent=NULL);   // 标准构造函数 
	virtual ~CIMsgBox(); 
	afx_msg BOOL OnEraseBkgnd(CDC* pDC); 
	afx_msg void OnClose(); 
protected: 
	CWnd			*m_pParentWnd; 
	CString			m_strText; 
	CStringArray	m_arrText; 
	CSize			m_szMsgBox; 
	CString			m_strTitle; 
	struct tagBtnInfo 
	{ 
		CIBitmapButton	btnUser; 
		CPoint			pt; 
		CString			strText; 
	}; 
	vectorm_vctBtn; 
	HICON			m_hIcon; 
	UINT			m_nType; 
	char			m_cClassName[100]; 
//--{{常数 
	int				m_iDistance;//按钮间距 
	CSize			m_szMsgBoxMin;//m_szMsgBox的最小值 
	int				m_iBtnTop;//按钮Top 
	int				m_iTextDistance;//字间距 
//--}} 
	int				m_iUserSel; 
protected: 
	int				GetButtonCount(); 
	void			FreeBtn(); 
	CIBitmapButton	*GetButton(HWND hWndBtn); 
protected: 
	virtual BOOL PreTranslateMessage(MSG* pMsg); 
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持 
	virtual BOOL OnInitDialog(); 
	virtual void CreateBtn(); 
	virtual	void DrawText(CDC *pDC); 
	virtual	void DrawImage(CDC *pDC); 
	virtual void OnOK(); 
	virtual void OnCancel(); 
public: 
	vector*GetBtnInfo(); 
	void	CalcWindowSize(); 
	void	LoadIcon(UINT nType); 
	void	SetType(UINT nType); 
	void	SetTitle(const CString &strTitle); 
	int		GetUserSel(); 
	//0x0000 0010  High 16bit Btns----Low 16bit Icon  
	int		Show(CWnd *pParentWnd,LPCTSTR lpszText,LPCTSTR lpszTitle,UINT nType,...); 
	friend	int MessageBoxZ(CWnd *pParentWnd,LPCTSTR lpszText,LPCTSTR lpszTitle,UINT nType,...); 
};