SkinPlusPlus.h
上传用户:zhuzhu0204
上传日期:2020-07-13
资源大小:13165k
文件大小:4k
开发平台:

Visual C++

  1.  
  2. #ifndef _SKINPLUSPLUS_H_
  3. #define _SKINPLUSPLUS_H_
  4. #ifdef SKINPLUSPLUSDLL
  5. #define SKINPLUSPLUS_DLL_DECLARE  _declspec(dllexport)
  6. #else
  7. #define SKINPLUSPLUS_DLL_DECLARE  _declspec(dllimport)
  8. #pragma comment(lib,"SkinPlusPlusDLL.lib") 
  9. #pragma message("Automatically linking with SkinPlusPlusDLL.dll") 
  10. #endif
  11. #pragma pack(push, 8)
  12. ///////////////////////////////////////////////////////////////////////////
  13. //Function: 
  14. //Parameters: 
  15. //Return Values:
  16. //Remarks:
  17. #define WM_TOOLBARPAINTPRE (WM_USER + 802)
  18. #define WM_TOOLBARPAINTEND (WM_USER + 803)
  19. #define WM_GETSPLITINFO (WM_USER + 804)
  20. struct CRowColInfo
  21. {
  22. int nMinSize;     
  23. int nIdealSize;   
  24. int nCurSize;
  25. };
  26. struct SplitInfo{
  27. HWND hWnd;
  28. int nMaxRows;
  29. int nMaxCols;
  30. int cxSplitter;
  31. int cySplitter;   
  32. int cxBorderShare;
  33. int cyBorderShare;
  34. int cxSplitterGap;
  35. int cySplitterGap;
  36. int cxBorder;
  37. int cyBorder;
  38. // current state information
  39. int nRows;
  40. int nCols;
  41. BOOL bHasHScroll;
  42. BOOL bHasVScroll;
  43. CRowColInfo* pColInfo;
  44. CRowColInfo* pRowInfo;
  45. };
  46. enum BUTTONSTATE 
  47. {
  48. NORMAL = 0,
  49. PRESS = 1,
  50. DISABLE = 2,
  51. HOT = 3,
  52. FOCUS   = 4,
  53. LAST = 5
  54. };
  55. enum DRAWTYPE
  56. {
  57. BUTTON = 0,
  58. SCROLLARROWUP = 1,
  59. SCROLLARROWDOWN = 2,
  60. SPLITTERBARHORZ = 3,
  61. SPLITTERBARVERT = 4,
  62. LISTHEAD = 5,
  63. };
  64. SKINPLUSPLUS_DLL_DECLARE BOOL  __stdcall InitializeSkin(char* SkinFile);
  65. SKINPLUSPLUS_DLL_DECLARE BOOL  __stdcall ExitSkin();
  66. SKINPLUSPLUS_DLL_DECLARE BOOL  __stdcall LoadSkin(char* SkinFile);
  67. SKINPLUSPLUS_DLL_DECLARE BOOL  __stdcall RemoveSkin();
  68. SKINPLUSPLUS_DLL_DECLARE BOOL  __stdcall SetMenuItemImage(UINT nID, HIMAGELIST hImgList, int nIndex);
  69. SKINPLUSPLUS_DLL_DECLARE HMENU __stdcall GetMainFrameMenu(void);
  70. SKINPLUSPLUS_DLL_DECLARE void  __stdcall DrawSkinObject(HDC hdc,RECT rect,DRAWTYPE eDrawType,int nState);
  71. SKINPLUSPLUS_DLL_DECLARE void  __stdcall DrawSkinBitmap(HDC hdc,RECT rect,HBITMAP hBitmap,int nTopHeight = 0,int nBottomHeight = 0,
  72.     int nLeftWidth = 0,int nRightWidth = 0,COLORREF colTrans = -1,BOOL bTrans = FALSE);
  73. SKINPLUSPLUS_DLL_DECLARE COLORREF __stdcall GetSkinSysColor(int nColorIndex);
  74. SKINPLUSPLUS_DLL_DECLARE COLORREF __stdcall GetDefaultSysColor(int nColorIndex);
  75. SKINPLUSPLUS_DLL_DECLARE void __stdcall SetNoSkinHwnd(HWND hWnd);
  76. typedef int (__stdcall * PGETSPLITTERINFO)(SplitInfo& si);
  77. SKINPLUSPLUS_DLL_DECLARE void __stdcall GetSplitterInfo(PGETSPLITTERINFO func);
  78. extern PGETSPLITTERINFO  g_CallBack;
  79. //Splitter
  80. #define SKINPLUSPLUS_SPLITTER() 
  81. int CALLBACK GetSplitterInfoProc(SplitInfo& si); 
  82. class CExSplitterWnd : public CSplitterWnd 
  83. {friend int CALLBACK GetSplitterInfoProc(SplitInfo& si);}; 
  84. CExSplitterWnd* g_wndSplitter = NULL; 
  85. int CALLBACK GetSplitterInfoProc(SplitInfo& si) 
  86. si.nMaxRows = g_wndSplitter->m_nMaxRows; 
  87. si.nMaxCols = g_wndSplitter->m_nMaxCols; 
  88. si.cxSplitter = g_wndSplitter->m_cxSplitter; 
  89. si.cySplitter = g_wndSplitter->m_cySplitter; 
  90. si.cxBorderShare = g_wndSplitter->m_cxBorderShare; 
  91. si.cyBorderShare = g_wndSplitter->m_cyBorderShare; 
  92. si.cxSplitterGap = g_wndSplitter->m_cxSplitterGap; 
  93. si.cySplitterGap = g_wndSplitter->m_cySplitterGap; 
  94. si.cxBorder = g_wndSplitter->m_cxBorder; 
  95. si.cyBorder = g_wndSplitter->m_cyBorder; 
  96. si.nRows = g_wndSplitter->m_nRows; 
  97. si.nCols = g_wndSplitter->m_nCols; 
  98. si.bHasHScroll = g_wndSplitter->m_bHasHScroll; 
  99. si.bHasVScroll = g_wndSplitter->m_bHasVScroll; 
  100. si.pColInfo = (CRowColInfo *)g_wndSplitter->m_pColInfo; 
  101. si.pRowInfo = (CRowColInfo *)g_wndSplitter->m_pRowInfo; 
  102. return 0; 
  103. #define SKINPLUSPLUS_INIT_SPLITTER(classname) 
  104. g_wndSplitter = (CExSplitterWnd *)&classname;
  105. GetSplitterInfo(GetSplitterInfoProc);
  106. //Splitter
  107. #pragma pack(pop)
  108. #endif