MessageBox.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef INFORMATION_HEAD_FILE
  2. #define INFORMATION_HEAD_FILE
  3. #pragma once
  4. #include "ShareControlHead.h"
  5. //////////////////////////////////////////////////////////////////////////////////
  6. //消息窗口
  7. class SHARE_CONTROL_CLASS CInformation : public CSkinDialog
  8. {
  9. //属性变量
  10. protected:
  11. UINT m_uType; //消息类型
  12. CString m_strString; //提示消息
  13. CString m_strCaption; //信息标题
  14. //辅助变量
  15. protected:
  16. UINT m_nElapse; //剩余时间
  17. UINT m_nBtCount; //按钮数目
  18. CRect m_rcString; //字符位置
  19. HINSTANCE m_hResInstance; //资源句柄
  20. //控件变量
  21. protected:
  22. CSkinButton m_btButton[3]; //按钮控件
  23. //函数定义
  24. public:
  25. //构造函数
  26. CInformation(CWnd * pParentWnd=NULL);
  27. //析构函数
  28. virtual ~CInformation();
  29. //重载函数
  30. protected:
  31. //初始化消息
  32. virtual BOOL OnInitDialog();
  33. //命令消息
  34. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  35. //功能函数
  36. public:
  37. //显示消息
  38. INT ShowMessageBox(LPCTSTR pszString, UINT uType=MB_OK, UINT nElapse=0);
  39. //显示消息
  40. INT ShowMessageBox(LPCTSTR pszCaption, LPCTSTR pszString, UINT uType=MB_OK, UINT nElapse=0);
  41. //内部函数
  42. private:
  43. //创建按钮
  44. VOID CreateBoxButton();
  45. //消息映射
  46. protected:
  47. //绘画消息
  48. VOID OnPaint();
  49. //时间消息
  50. VOID OnTimer(UINT_PTR nIDEvent);
  51. DECLARE_MESSAGE_MAP()
  52. };
  53. //////////////////////////////////////////////////////////////////////////////////
  54. //全局函数
  55. extern "C" SHARE_CONTROL_CLASS INT ShowInformation(LPCTSTR pszString, UINT uType=MB_OK, UINT nElapse=0);
  56. extern "C" SHARE_CONTROL_CLASS INT ShowInformationEx(LPCTSTR pszCaption, LPCTSTR pszString, UINT uType=MB_OK, UINT nElapse=0);
  57. //////////////////////////////////////////////////////////////////////////////////
  58. #endif