WndEx.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #if !defined(AFX_WNDEX_H__E14EA019_CE71_469A_AEB4_3D3CB271C531__INCLUDED_)
  2. #define AFX_WNDEX_H__E14EA019_CE71_469A_AEB4_3D3CB271C531__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // WndEx.h : header file
  7. //
  8. #define CAPTION_BORDER 16
  9. #define BORDER 2
  10. #define SWAP_MIN_MAX 1
  11. #define FORCE_MIN 2
  12. #define FORCE_MAX 3
  13. class CWndEx : public CWnd
  14. {
  15. // Construction
  16. public:
  17. CWndEx();
  18. // Attributes
  19. public:
  20. // Operations
  21. public:
  22. // Overrides
  23. // ClassWizard generated virtual function overrides
  24. //{{AFX_VIRTUAL(CWndEx)
  25. public:
  26. virtual BOOL Create(const CRect& crStart, CWnd* pParentWnd);
  27. virtual BOOL PreTranslateMessage(MSG* pMsg);
  28. //}}AFX_VIRTUAL
  29. public:
  30. void SetResizable(bool bVal) { m_bResizable = bVal; }
  31. COLORREF m_CaptionColorLeft;
  32. COLORREF m_CaptionColorRight;
  33. bool SetCaptionColors( COLORREF left, COLORREF right );
  34. bool SetCaptionColorActive(bool bActive, bool ConnectedToClipboard);
  35. void InvalidateNc();
  36. void SetCaptionOn(int nPos, bool bOnstartup = false);
  37. void SetAutoHide(BOOL bAutoHide);
  38. void MinMaxWindow(long lOption = SWAP_MIN_MAX);
  39. void GetWindowRectEx(LPRECT lpRect);
  40. protected:
  41. CFont m_TitleFont;
  42. CFont m_HorFont;
  43. bool m_bResizable;
  44. CRect m_crCloseBT;
  45. CRect m_crMinimizeBT;
  46. bool m_bMouseOverClose;
  47. bool m_bMouseDownOnClose;
  48. bool m_bMouseDownOnCaption;
  49. bool m_bMouseOverMinimize;
  50. bool m_bMouseDownOnMinimize;
  51. long m_lTopBorder;
  52. long m_lRightBorder;
  53. long m_lBottomBorder;
  54. long m_lLeftBorder;
  55. CRect m_crFullSizeWindow;
  56. bool m_bMinimized;
  57. bool m_bMaxSetTimer;
  58. void DrawCloseBtn(CWindowDC &dc, COLORREF left = 0);
  59. void DrawMinimizeBtn(CWindowDC &dc, COLORREF left = 0);
  60. void SetRegion();
  61. // Implementation
  62. public:
  63. virtual ~CWndEx();
  64. // Generated message map functions
  65. protected:
  66. //{{AFX_MSG(CWndEx)
  67. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  68. afx_msg void OnNcPaint();
  69. afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
  70. afx_msg UINT OnNcHitTest(CPoint point);
  71. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  72. afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
  73. afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
  74. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  75. afx_msg void OnTimer(UINT nIDEvent);
  76. afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
  77. afx_msg void OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex,BOOL bSysMenu);
  78. //}}AFX_MSG
  79. DECLARE_MESSAGE_MAP()
  80. public:
  81. // afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point);
  82. // afx_msg BOOL OnNcActivate(BOOL bActive);
  83. afx_msg void OnSize(UINT nType, int cx, int cy);
  84. };
  85. /////////////////////////////////////////////////////////////////////////////
  86. //{{AFX_INSERT_LOCATION}}
  87. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  88. #endif // !defined(AFX_WNDEX_H__E14EA019_CE71_469A_AEB4_3D3CB271C531__INCLUDED_)