00001
00002
00003
00004
00005
00006 #if !defined(AFX_MYMESSAGEBOX_H__611389DA_FD32_41A3_A149_12BDFFA82B97__INCLUDED_)
00007 #define AFX_MYMESSAGEBOX_H__611389DA_FD32_41A3_A149_12BDFFA82B97__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif
00012
00013 class CMyMessageBox : public CDialog
00014 {
00015
00016 public:
00017 CMyMessageBox(CWnd* pParent = NULL);
00018
00019
00020 enum { IDD = IDD_MYMESSAGEBOX };
00021 CButton m_wndCheckbox;
00022 CButton m_wndBtn3;
00023 CButton m_wndBtn2;
00024 CButton m_wndBtn1;
00025 CStatic m_wndMsg;
00026 CStatic m_wndIcon;
00027
00028
00029
00030 protected:
00031 virtual void DoDataExchange(CDataExchange* pDX);
00032
00033
00034 public:
00035 CString m_strCheckBoxText;
00036 bool m_bChecked;
00037 CString m_strText;
00038 CString m_strTitle;
00039 CString m_strBtn1Text,
00040 m_strBtn2Text, m_strBtn3Text;
00041 HICON m_hIcon;
00042
00043 protected:
00044
00045
00046 virtual BOOL OnInitDialog();
00047 afx_msg void OnBtn1();
00048 afx_msg void OnBtn2();
00049 afx_msg void OnBtn3();
00050 virtual void OnCancel();
00051
00052 DECLARE_MESSAGE_MAP()
00053 };
00054
00055 inline UINT MyMessageBox (CWnd* pwndParent, LPCSTR pszText, LPCSTR pszTitle,
00056 LPCSTR pszCheckbox, LPCSTR pszSysIcon = NULL, LPCSTR pszBtn1Text = "OK", LPCSTR pszBtn2Text = NULL,
00057 LPCSTR pszBtn3Text = NULL)
00058 {
00059 CMyMessageBox mb (pwndParent);
00060
00061 if (pszSysIcon)
00062 mb.m_hIcon = LoadIcon (NULL, pszSysIcon);
00063
00064 mb.m_strBtn1Text = pszBtn1Text;
00065
00066 if (pszBtn2Text)
00067 {
00068 mb.m_strBtn2Text = pszBtn2Text;
00069 if (pszBtn3Text)
00070 mb.m_strBtn3Text = pszBtn3Text;
00071 }
00072
00073 if (pszCheckbox)
00074 mb.m_strCheckBoxText = pszCheckbox;
00075
00076 mb.m_strText = pszText;
00077 mb.m_strTitle = pszTitle;
00078
00079 UINT nRet = _DlgMgr.DoModal (&mb);
00080
00081 if (mb.m_bChecked)
00082 nRet |= 0x00010000;
00083
00084 return nRet;
00085 }
00086
00087
00088
00089 #endif