BkDialogST.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //
  2. // Class: CBkDialogST
  3. //
  4. // Compiler: Visual C++
  5. // Tested on: Visual C++ 6.0
  6. //
  7. // Version: See GetVersionC() or GetVersionI()
  8. //
  9. // Created: 01/September/2000
  10. // Updated: 26/July/2002
  11. //
  12. // Author: Davide Calabro' davide_calabro@yahoo.com
  13. // http://www.softechsoftware.it
  14. //
  15. // Disclaimer
  16. // ----------
  17. // THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT
  18. // ANY WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO REPONSIBILITIES FOR POSSIBLE
  19. // DAMAGES OR EVEN FUNCTIONALITY CAN BE TAKEN. THE USER MUST ASSUME THE ENTIRE
  20. // RISK OF USING THIS SOFTWARE.
  21. //
  22. // Terms of use
  23. // ------------
  24. // THIS SOFTWARE IS FREE FOR PERSONAL USE OR FREEWARE APPLICATIONS.
  25. // IF YOU USE THIS SOFTWARE IN COMMERCIAL OR SHAREWARE APPLICATIONS YOU
  26. // ARE GENTLY ASKED TO DONATE 1$ (ONE U.S. DOLLAR) TO THE AUTHOR:
  27. //
  28. // Davide Calabro'
  29. // P.O. Box 65
  30. // 21019 Somma Lombardo (VA)
  31. // Italy
  32. //
  33. #ifndef _BKDIALOGST_H_
  34. #define _BKDIALOGST_H_
  35. #if _MSC_VER > 1000
  36. #pragma once
  37. #endif // _MSC_VER > 1000
  38. // Return values
  39. #ifndef BKDLGST_OK
  40. #define BKDLGST_OK 0
  41. #endif
  42. #ifndef BKDLGST_INVALIDRESOURCE
  43. #define BKDLGST_INVALIDRESOURCE 1
  44. #endif
  45. #ifndef BKDLGST_INVALIDMODE
  46. #define BKDLGST_INVALIDMODE 2
  47. #endif
  48. #ifndef BKDLGST_FAILEDREGION
  49. #define BKDLGST_FAILEDREGION 3
  50. #endif
  51. class CBkDialogST : public CDialog
  52. {
  53. public:
  54. CBkDialogST(CWnd* pParent = NULL);
  55. CBkDialogST(UINT uResourceID, CWnd* pParent = NULL);
  56. CBkDialogST(LPCTSTR pszResourceID, CWnd* pParent = NULL);
  57. virtual ~CBkDialogST();
  58. DWORD SetMode(BYTE byMode, BOOL bRepaint = TRUE);
  59. DWORD SetBitmap(HBITMAP hBitmap, COLORREF crTransColor = -1L);
  60. DWORD SetBitmap(int nBitmap, COLORREF crTransColor = -1L);
  61. DWORD ActivateEasyMoveMode(BOOL bActivate);
  62. #ifndef UNDER_CE
  63. DWORD ShrinkToFit(BOOL bRepaint = TRUE);
  64. #endif
  65. enum {
  66. BKDLGST_MODE_TILE = 0,
  67. BKDLGST_MODE_CENTER,
  68. BKDLGST_MODE_STRETCH,
  69. BKDLGST_MODE_TILETOP,
  70. BKDLGST_MODE_TILEBOTTOM,
  71. BKDLGST_MODE_TILELEFT,
  72. BKDLGST_MODE_TILERIGHT,
  73. BKDLGST_MODE_TOPLEFT,
  74. BKDLGST_MODE_TOPRIGHT,
  75. BKDLGST_MODE_TOPCENTER,
  76. BKDLGST_MODE_BOTTOMLEFT,
  77. BKDLGST_MODE_BOTTOMRIGHT,
  78. BKDLGST_MODE_BOTTOMCENTER,
  79. BKDLGST_MAX_MODES
  80. };
  81. //{{AFX_DATA(CBkDialogST)
  82. // NOTE: the ClassWizard will add data members here
  83. //}}AFX_DATA
  84. // ClassWizard generated virtual function overrides
  85. //{{AFX_VIRTUAL(CBkDialogST)
  86. //}}AFX_VIRTUAL
  87. protected:
  88. // Generated message map functions
  89. //{{AFX_MSG(CBkDialogST)
  90. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  91. afx_msg void OnSize(UINT nType, int cx, int cy);
  92. //}}AFX_MSG
  93. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  94. virtual void OnPostEraseBkgnd(CDC* pDC);
  95. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  96. static short GetVersionI() {return 12;}
  97. static LPCTSTR GetVersionC() {return (LPCTSTR)_T("1.2");}
  98. private:
  99. void Init();
  100. void FreeResources(BOOL bCheckForNULL = TRUE);
  101. #ifndef UNDER_CE
  102. HRGN ScanRegion(HBITMAP hBitmap, BYTE byTransR, BYTE byTransG, BYTE byTransB);
  103. LPBYTE Get24BitPixels(HBITMAP hBitmap, LPDWORD lpdwWidth, LPDWORD lpdwHeight);
  104. #endif
  105. HBITMAP m_hBitmap; // Handle to bitmap
  106. #ifndef UNDER_CE
  107. HRGN m_hRegion; // Handle to region
  108. #endif
  109. DWORD m_dwWidth; // Width of bitmap
  110. DWORD m_dwHeight; // Height of bitmap
  111. BYTE m_byMode; // Current drawing bitmap mode
  112. BOOL m_bEasyMoveMode; // Indicates if EasyMove mode must be used
  113. DECLARE_MESSAGE_MAP()
  114. };
  115. //{{AFX_INSERT_LOCATION}}
  116. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  117. #endif