SkinDialog.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #pragma once
  2. #include "SkinUI.h"
  3. #include "ISkinControl.h"
  4. class SKINUI_CLASS CSkinDialog : public CDialog,public ISkinControl,public CBuildDialog
  5. {
  6. DECLARE_DYNAMIC(CSkinDialog)
  7. protected:
  8. ISkinControl m_SkinControl;
  9. HDC m_hMemDC;
  10. HBITMAP m_hMemBmp, m_hOldBmp;
  11. CRect m_rcWindowSizeNow;
  12. public:
  13. CSkinDialog(UINT nIDTemplate,LPCTSTR lpszFileName=NULL,CWnd* pParent = NULL); // 标准构造函数
  14. virtual ~CSkinDialog();
  15. //接口函数
  16. protected:
  17. //初始化
  18. virtual BOOL OnInitDialog();
  19. //消息循环
  20. virtual BOOL PreTranslateMessage(MSG* pMsg);
  21. //窗口绘制
  22. virtual void DrawClientArea(CDC*pDC,int nWidth,int nHeight){}
  23. // DDX/DDV 支持
  24. virtual void DoDataExchange(CDataExchange* pDX);
  25. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  26. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  27. public:
  28. //设置拉伸
  29. void SetExtrude(bool bExtrude);
  30. //最大化窗口
  31. void SetMaxWindow();
  32. //功能函数
  33. public:
  34. //获取背景
  35. HDC GetBackDC(){ return m_hMemDC; }
  36. //剪辑子窗口
  37. void SetClipChild(bool bClip);
  38. //消息函数
  39. public:
  40. //绘画消息
  41. afx_msg void OnPaint();
  42. //点击消息
  43. afx_msg LRESULT OnNcHitTest(CPoint point);
  44. //窗口尺寸
  45. afx_msg void OnSize(UINT nType, int cx, int cy);
  46. //窗口大小
  47. afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
  48. //刷新背景
  49. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  50. //裁剪边框
  51. afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
  52. //非客户区激活
  53. afx_msg BOOL OnNcActivate(BOOL bActive);
  54. //系统消息
  55. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  56. //静态函数
  57. protected:
  58. //枚举函数
  59. static BOOL CALLBACK EnumChildProc(HWND hWndChild, LPARAM lParam);
  60. protected:
  61. //调整控件
  62. void RectifyControl( int cx, int cy );
  63. DECLARE_MESSAGE_MAP()
  64. };