SkinMagicLib.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. /***************************************************************************
  2. // This is a part of the SkinMagic SDK library.
  3. // Copyright (C) 2009-2002 Appspeed Inc.
  4. // All rights reserved.
  5. //
  6. // This source code is only intended as a supplement to the
  7. // SkinMagic SDK Reference and related electronic documentation
  8. // provided with the library.
  9. // See these sources for detailed information regarding the
  10. // SkinMagic SDK product.
  11. // SkinMagicLib SDK is a library designed for C/C++ programmer,
  12. // you can add the most popular function of changing skin to your
  13. // application with the API supplied by this library. SkinMagic
  14. // is picture-based skin system, you can power your application
  15. // with skin-changeable with simple call of several functions.
  16. // And with the skin editor of SkinMagicBuilder, you can customize
  17. // your own skin.
  18. *****************************************************************************/
  19. #ifndef _SKINMAGICLIB_H__
  20. #define _SKINMAGICLIB_H__
  21. #include <windows.h>
  22. #include <commctrl.h>
  23. //Skinmagic error code
  24. #define SMEC_OK 0
  25. #define SMEC_REGISTERWINDOW 1 //fail to register windows class
  26. #define SMEC_MESSAGEHOOK 2 //fail to set message hook
  27. #define SMEC_KEYHOOK 3 //fail to set keyboard hook
  28. #define SMEC_FILENOTFOUND 4 //not find the file
  29. #define SMEC_DECOMPRESSERROR 5 //fail to decompress skin file
  30. #define SMEC_HEADERERROR 6 //skin file header error
  31. #define SMEC_SKINVERSIONERROR 7 //skin file version not match
  32. #define SMEC_OBJECTNOTFOUND 8 //obect not found
  33. #define SMEC_OBJECTTYPEUNMATCH 9 //Object type not match
  34. #define SMEC_IMAGESIZEERROR 10 //Image size error
  35. #define SMEC_CREATEIMAGELISTFAIL 11 //fail to create image list object
  36. #define SMEC_NOTIMPLEMENT 12 //The function not implement
  37. #define SMEC_PARAMETERERROR 13 //the function parameter error
  38. #define SMEC_INITSCROLLBARFAIL 14 //fail to skin scrollbar
  39. #define SMEC_LOADRESOURCEFAIL 15 //fail to load the resource
  40. #define SMEC_FINDRESOURCEFAIL 16 //fail to find the resource
  41. #define SMEC_WINDOWSXPNOTCOMPATIBLE 17 //not compatible with Windows XP
  42. #define SMEC_OUTOFMEMORY 18 //Out of memory
  43. #define SMEC_LIBARAYNOTINITIALIZED 19 //Library not initialized
  44. #pragma pack(push, 8)
  45. ///////////////////////////////////////////////////////////////////////////
  46. //Function: InitSkinMagicLib(HINSTANCE hInstance, LPCTSTR szApplication ,
  47. // LPCTSTR szReserved1,
  48. // LPCTSTR szReserved2
  49. //
  50. //Parameters:
  51. // hInstance
  52. // [in] Handle of application instance.
  53. // szApplication
  54. // [in] Application defined in skin file. If you set this parameter the
  55. // library can only load the skin file which application object named
  56. // match szApplication.
  57. // szReserved1
  58. // [in] Reserved.
  59. // szReserved2
  60. // [in] Reserved.
  61. //Return Values:
  62. // If the function success, the return value is nonzero
  63. // If the function fail, the return value is zero
  64. //Remarks:
  65. // InitSkinMagicLib function should be the first API called in SkinMagicLib SDK,
  66. // followed by other APIs.
  67. // For multithreaded applications, you must call InitSkinMagicLib in every thread.
  68. //
  69. int __stdcall InitSkinMagicLib( HINSTANCE hInstance,
  70. LPCTSTR lpApplication ,
  71. LPCTSTR lpReserved1,
  72. LPCTSTR lpReserved2 );
  73. ///////////////////////////////////////////////////////////////////////////
  74. //Function: LoadSkinFile( LPCTSTR SkinFile )
  75. // Load skin from file.
  76. //Parameters:
  77. // SkinFile
  78. // [in] Specifies the skin file name.
  79. //Return Values:
  80. // If the function success, the return value is nonzero
  81. // If the function fail, the return value is zero
  82. //Remarks:
  83. // ExitSkinMagicLib function should be the last API called in SkinMagicLib SDK.
  84. // For multithreaded applications, you must call InitSkinMagicLib in every thread.
  85. void __stdcall ExitSkinMagicLib();
  86. ///////////////////////////////////////////////////////////////////////////
  87. //Function: LoadSkinFile( LPCTSTR SkinFile )
  88. // Load skin from file.
  89. //Parameters:
  90. // SkinFile
  91. // [in] Specifies the skin file name.
  92. //Return Values:
  93. // If the function success, the return value is nonzero
  94. // If the function fail, the return value is zero
  95. //Remarks:
  96. // Load skin from file.
  97. int __stdcall LoadSkinFile( LPCTSTR lpSkinFile );
  98. ///////////////////////////////////////////////////////////////////////////
  99. //Function: LoadSkinFromResource(HMODULE hModule, LPCTSTR lpSkinName ,LPCTSTR lpType)
  100. // Use this function to load skin from resource.
  101. //Parameters:
  102. // hModule
  103. // [in] Handle to the module whose executable file contains the resource.
  104. // A value of NULL specifies the module handle associated with the image
  105. // file that the operating system used to create the current process.
  106. // lpSkinName
  107. // [in] Specifies the name of the skin resource.
  108. // lpType
  109. // [in] Specifies the resource type.
  110. //Return Values:
  111. // If the function success, the return value is nonzero
  112. // If the function fail, the return value is zero
  113. //Remarks:
  114. // The application can use skin defined in resource.
  115. int __stdcall LoadSkinFromResource(HMODULE hModule, LPCTSTR lpSkinName ,LPCTSTR lpType);
  116. ///////////////////////////////////////////////////////////////////////////
  117. //Function: SetWindowSkin( HWND hWnd , LPCTSTR SkinName )
  118. // Use SetWindowSkin to skin the standard windows - with rectangular
  119. // opaque client area and region-based non-client area, menu bar,
  120. // system/maximize/minimize/close buttons, caption and sizing edges
  121. // and corners.
  122. //
  123. //Parameters:
  124. // hWnd
  125. // [in]Handle to the window to be remove skin.
  126. // SkinName
  127. // [in]Specifies the name of FrameWnd object which defined in skin file.
  128. //
  129. //Return Values:
  130. // If the function success, the return value is nonzero
  131. // If the function fail, the return value is zero
  132. //Remarks:
  133. // Use SetWindowSkin to skin the standard windows - with rectangular
  134. // opaque client area and region-based non-client area, menu bar,
  135. // system/maximize/minimize/close buttons, caption and sizing edges
  136. // and corners.
  137. int __stdcall SetWindowSkin( HWND hWnd , LPCTSTR lpSkinName );
  138. ///////////////////////////////////////////////////////////////////////////
  139. //Function: SetShapeWindowSkin( HWND hWnd , LPCTSTR SkinName )
  140. // Use SetShapeWindowSkin to skin application-specific windows
  141. // without non-client area and menu bar. These windows can have
  142. // absolutely any shape or even be translucent.
  143. //
  144. //Parameters:
  145. // hWnd
  146. // [in]Handle to the window to be remove skin.
  147. // SkinName
  148. // [in]Specifies the name of ShapeWnd object which defined in skin file.
  149. //
  150. //Return Values:
  151. // If the function success, the return value is nonzero
  152. // If the function fail, the return value is zero
  153. //Remarks:
  154. // Use SetShapeWindowSkin to skin application-specific windows
  155. // without non-client area and menu bar. These windows can have
  156. // absolutely any shape or even be translucent.
  157. //
  158. int __stdcall SetShapeWindowSkin( HWND hWnd , LPCTSTR SkinName );
  159. ///////////////////////////////////////////////////////////////////////////
  160. //Function: RemoveWindowSkin( HWND hWnd )
  161. // set skin of new create dialog
  162. //
  163. //Parameters:
  164. // hWnd
  165. // [in]Handle to the window to be remove skin.
  166. //
  167. //Return Values:
  168. // If the function success, the return value is nonzero
  169. // If the function fail, the return value is zero
  170. //Remarks:
  171. // Use this function to remove window skin.
  172. //
  173. int __stdcall RemoveWindowSkin( HWND hWnd );
  174. ///////////////////////////////////////////////////////////////////////////
  175. //Function: SetDialogSkin( LPCTSTR szSkinName )
  176. // set skin of new create dialog
  177. //
  178. //Parameters:
  179. // szSkinName
  180. // [in]Specifies the name of FrameWnd object which defined in skin file.
  181. //
  182. //Return Values:
  183. // If the function success, the return value is nonzero
  184. // If the function fail, the return value is zero
  185. //Remarks:
  186. // Use this function to set dialog skin. dialog will auto be skinned
  187. // after this function called.
  188. //
  189. int __stdcall SetDialogSkin( LPCTSTR szSkinName );
  190. ///////////////////////////////////////////////////////////////////////////
  191. //Function: SetSingleDialogSkin( HWND hWnd ,LPCTSTR szSkinName )
  192. // Set the skin of an dialog
  193. //
  194. //Parameters:
  195. // hWnd
  196. // [in]Handle to the dialog to be set skin.
  197. // szSkinName
  198. // [in]Specifies the skin nanem.
  199. //
  200. //Return Values:
  201. // If the function success, the return value is nonzero
  202. // If the function fail, the return value is zero
  203. //Remarks:
  204. // Use this function to set single dialog skin.
  205. //
  206. int __stdcall SetSingleDialogSkin( HWND hWnd , LPCTSTR szSkinName );
  207. ///////////////////////////////////////////////////////////////////////////
  208. //Function: RemoveDialogSkin()
  209. // This function will stop auto skin dialog.
  210. // the function will not remove the dialog's
  211. // skin which already set. The new create dialog will have no skin.
  212. //
  213. //Parameters:
  214. // none.
  215. //Return Values:
  216. // If the function success, the return value is nonzero
  217. // If the function fail, the return value is zero
  218. //Remarks:
  219. // Use this function to stop auto skin dialog.
  220. //
  221. int __stdcall RemoveDialogSkin();
  222. ///////////////////////////////////////////////////////////////////////////
  223. //Function: EnableWindowScrollbarSkin( HWND hWnd ,int fnBar )
  224. // Initialize the skin scrollbars for a window
  225. //
  226. //Parameters:
  227. // hWnd
  228. // [in]Handle to the window to be set skin scrollbar.
  229. // fnBar
  230. // [in]Specifies the type of scroll bar for which to skin.
  231. // This parameter can be one of the following values
  232. // SB_HORZ for the window's standard horizontal scroll bar.
  233. // SB_VERT for the window's standard scroll bar.
  234. // SB_BOTH for both horizontal and vertical scroll bar.
  235. //
  236. //Return Values:
  237. // If the function success, the return value is nonzero
  238. // If the function fail, the return value is zero
  239. //Remarks:
  240. // Use this function to skin your window scrollbar
  241. //
  242. int __stdcall EnableWindowScrollbarSkin( HWND hWnd ,int fnBar );
  243. ///////////////////////////////////////////////////////////////////////////
  244. //Function: DisableWindowScrollbarSkin( HWND hWnd )
  245. // disable the skin scrollbars for a window
  246. //
  247. //Parameters:
  248. // hWnd
  249. // [in]Handle to the window to be disable skin scrollbar.
  250. //
  251. //Return Values:
  252. // If the function success, the return value is nonzero
  253. // If the function fail, the return value is zero
  254. //Remarks:
  255. // Use this function to skin your window scrollbar
  256. //
  257. int __stdcall DisableWindowScrollbarSkin( HWND hWnd );
  258. ///////////////////////////////////////////////////////////////////////////
  259. //Function: TrackSkinPopupMenu( HMENU hMenu,int x, int y, HWND hWnd )
  260. // The TrackSkinPopupMenu function displays a shortcut menu at the
  261. // specified location and tracks the selection of items on the menu.
  262. // The shortcut menu can appear anywhere on the screen.
  263. //
  264. //Parameters
  265. // hMenu
  266. // [in] Handle to the shortcut menu to be displayed.
  267. // The handle can be obtained by calling CreatePopupMenu
  268. // to create a new shortcut menu, or by calling GetSubMenu
  269. // to retrieve a handle to a submenu associated with an
  270. // existing menu item.
  271. //uFlags
  272. // [in] Use zero of more of these flags to specify function options.
  273. // Use one of the following flags to specify how the function positions
  274. // the shortcut menu horizontally.
  275. // ------------------------------------------------------------------------------
  276. // TPM_CENTERALIGN If this flag is set, the function centers the shortcut
  277. // menu horizontally relative to the coordinate specified
  278. // by the x parameter.
  279. // TPM_LEFTALIGN If this flag is set, the function positions the shortcut
  280. // menu so that its left side is aligned with the coordinate
  281. // specified by the x parameter.
  282. // TPM_RIGHTALIGN Positions the shortcut menu so that its right side is
  283. // aligned with the coordinate specified by the x parameter.
  284. // ------------------------------------------------------------------------------
  285. // Use one of the following flags to specify how the function positions the shortcut
  286. // menu vertically.
  287. // TPM_BOTTOMALIGN If this flag is set, the function positions the shortcut
  288. // menu so that its bottom side is aligned with the coordinate
  289. // specified by the y parameter.
  290. // TPM_TOPALIGN If this flag is set, the function positions the shortcut
  291. // menu so that its top side is aligned with the coordinate
  292. // specified by the y parameter.
  293. // TPM_VCENTERALIGN If this flag is set, the function centers the shortcut menu
  294. // vertically relative to the coordinate specified by the y parameter.
  295. //
  296. // x
  297. // [in] Specifies the horizontal location of the shortcut menu,
  298. // in screen coordinates.
  299. // y
  300. // [in] Specifies the vertical location of the shortcut menu,
  301. // in screen coordinates.
  302. // hWnd
  303. // [in] Handle to the window that owns the shortcut menu.
  304. // This window receives all messages from the menu.
  305. // The window does not receive a WM_COMMAND message from the
  306. // menu until the function returns.
  307. BOOL __stdcall TrackSkinPopupMenu( HMENU hMenu, UINT uFlags, int x, int y, HWND hWnd );
  308. int __stdcall EnableCaptionButtons(HWND hWnd , LPCTSTR lpName , BOOL bEnable );
  309. //for custom control support
  310. #define WM_SKINDATACHANGED WM_USER + 2000
  311. //for
  312. #define WM_SETSKIN WM_APP + 1000
  313. typedef HANDLE HSKIN; // handle to a skin data object
  314. int __stdcall RegisterSkinWindow( HWND hWnd , UINT uNotifyMsg );
  315. int __stdcall UnregisterSkinWindow( HWND hWnd );
  316. HSKIN __stdcall OpenSkinData( LPCTSTR pszSkinObjectName );
  317. void __stdcall CloseSkinData( HSKIN hSkin );
  318. //stocked property for every custom control
  319. int __stdcall GetSkinControlRect( HSKIN hSkin , RECT* pRect, BOOL* pAutoPlace );
  320. int __stdcall GetSkinControlID( HSKIN hSkin , DWORD* dwID );
  321. int __stdcall GetSkinControlFont( HSKIN hSkin , HFONT* phFont , COLORREF* pColor );
  322. int __stdcall GetSkinControlColor( HSKIN hSkin , COLORREF* pColor );
  323. int __stdcall GetSkinControlBkColor( HSKIN hSkin , COLORREF* pColor );
  324. int __stdcall GetSkinTransparentColor( COLORREF* pColor , BOOL* pBool );
  325. //user customed property
  326. int __stdcall GetSkinFont( HSKIN hSkin,LPCTSTR pszName , LOGFONT* pLogFont , COLORREF* pColor );
  327. int __stdcall GetSkinColor( HSKIN hSkin , LPCTSTR pszName, COLORREF* pColor );
  328. int __stdcall GetSkinBool( HSKIN hSkin , LPCTSTR pszName, bool* pbVal );
  329. int __stdcall GetSkinInt( HSKIN hSkin , LPCTSTR pszName, int* piVal );
  330. int __stdcall GetSkinDWORD( HSKIN hSkin , LPCTSTR pszName, DWORD* pdwVal );
  331. int __stdcall GetSkinEnum( HSKIN hSkin , LPCTSTR pszName, DWORD* pdwVal );
  332. int __stdcall GetSkinString( HSKIN hSkin, LPCTSTR pszName , LPTSTR pszBuff , unsigned long* pMaxBuffChars );
  333. int __stdcall DrawSkinImageRect( HSKIN hSkin,
  334. LPCTSTR pszName,
  335. HDC hdc,
  336. RECT* pRect
  337. );
  338. int __stdcall DrawSkinImageSection( HSKIN hSkin,
  339. LPCTSTR pszName,
  340. HDC hdc,
  341. RECT* pRect );
  342. int __stdcall DrawSkinImageSectionFrame( HSKIN hSkin,
  343. LPCTSTR pszName,
  344. HDC hdc,
  345. RECT* pRect );
  346. int __stdcall GetSkinImageSectionMargins( HSKIN hSkin, LPCTSTR pszName , const RECT* pRect , const RECT* pMargins );
  347. int __stdcall CreateSkinImageRectRegion( HSKIN hSkin,
  348. LPCTSTR pszName,
  349. RECT* pBoundRect,
  350. SIZE* pImgSize,
  351. HRGN* pRegion);
  352. int __stdcall CreateSkinImageSectionRegion( HSKIN hSkin,
  353. LPCTSTR pszName,
  354. RECT* pRect,
  355. HRGN* pRegion );
  356. int __stdcall DrawSkinTextEffect( HSKIN hSkin,
  357. LPCTSTR pszName,
  358. HDC hdc,
  359. const RECT* pRect,
  360. LPCTSTR lpText,
  361. UINT uLen,
  362. UINT uFlag );
  363. ///////////////////////////////////////////////////////////////////////////////////////////////
  364. //CreateImageList
  365. //
  366. //The CreateImageList create a new image list from skin file.
  367. //
  368. // Parameters:
  369. // lpImagelistObjectName [in] The skinImageList object name.
  370. // Return Values
  371. // Returns the handle to the image list if successful, or NULL otherwise
  372. ///////////////////////////////////////////////////////////////////////////////////////////////
  373. HIMAGELIST __stdcall CreateImageList( LPCTSTR pszImageListObjectName );
  374. struct MENUIMAGEINFO
  375. {
  376. UINT itemID;
  377. int iImage;
  378. };
  379. //////////////////////////////////////////////////////////////////////////////////////////////////
  380. //Function: SetWindowMainMenuImage
  381. // The SetWindowMainMenuImage function set windows main menu item's bitmap.
  382. //
  383. //Parameters:
  384. // hWnd
  385. // [in] Handle to the window own the menu..
  386. // pMenuImage
  387. // [in] Pointer of an array of MENUIMAGEINFO struct .
  388. // nCount
  389. // [in] length of array pMenuImage.
  390. // hImageList
  391. // [in] imagelist used by the main menu to display normal item images.
  392. // hHotImageList
  393. // [in] imagelist used by the main menu to display hot item images.
  394. // hDisabledImagelist
  395. // [in] imagelist used by the main menu to display disabled item images.
  396. //
  397. //Return Values:
  398. // If the function success, the return value is nonzero
  399. // If the function fail, the return value is zero
  400. ///////////////////////////////////////////////////////////////////////////////////////////
  401. int __stdcall SetWindowMainMenuImage( HWND hWnd ,
  402. MENUIMAGEINFO* pMenuImage,
  403. UINT nCount ,
  404. HIMAGELIST hImageList ,
  405. HIMAGELIST hHotImageList,
  406. HIMAGELIST hDisabledImagelist );
  407. /////////////////////////////////////////////////////////////////////////////////////////////
  408. //Function: TrackSkinPopupMenuEx
  409. // The TrackSkinPopupMenuEx function displays a shortcut menu at the
  410. // specified location and tracks the selection of items on the menu.
  411. // The shortcut menu can appear anywhere on the screen.
  412. //
  413. //Parameters
  414. // hMenu
  415. // [in] Handle to the shortcut menu to be displayed.
  416. // The handle can be obtained by calling CreatePopupMenu
  417. // to create a new shortcut menu, or by calling GetSubMenu
  418. // to retrieve a handle to a submenu associated with an
  419. // existing menu item.
  420. // lpSkinPopupMenuName
  421. // [in] The SkinPopupMenu object name. If lpSkinPopupMenuName is NULL SkinMagic
  422. // use default popupmenu skindata.
  423. // uFlags
  424. // [in] Use zero of more of these flags to specify function options.
  425. // Use one of the following flags to specify how the function positions
  426. // the shortcut menu horizontally.
  427. // ------------------------------------------------------------------------------
  428. // TPM_CENTERALIGN If this flag is set, the function centers the shortcut
  429. // menu horizontally relative to the coordinate specified
  430. // by the x parameter.
  431. // TPM_LEFTALIGN If this flag is set, the function positions the shortcut
  432. // menu so that its left side is aligned with the coordinate
  433. // specified by the x parameter.
  434. // TPM_RIGHTALIGN Positions the shortcut menu so that its right side is
  435. // aligned with the coordinate specified by the x parameter.
  436. // ------------------------------------------------------------------------------
  437. // Use one of the following flags to specify how the function positions the shortcut
  438. // menu vertically.
  439. // TPM_BOTTOMALIGN If this flag is set, the function positions the shortcut
  440. // menu so that its bottom side is aligned with the coordinate
  441. // specified by the y parameter.
  442. // TPM_TOPALIGN If this flag is set, the function positions the shortcut
  443. // menu so that its top side is aligned with the coordinate
  444. // specified by the y parameter.
  445. // TPM_VCENTERALIGN If this flag is set, the function centers the shortcut menu
  446. // vertically relative to the coordinate specified by the y parameter.
  447. //
  448. // x
  449. // [in] Specifies the horizontal location of the shortcut menu,
  450. // in screen coordinates.
  451. // y
  452. // [in] Specifies the vertical location of the shortcut menu,
  453. // in screen coordinates.
  454. // hWnd
  455. // [in] Handle to the window that owns the shortcut menu.
  456. // This window receives all messages from the menu.
  457. // The window does not receive a WM_COMMAND message from the
  458. // menu until the function returns.
  459. // pMenuImage
  460. // [in] Pointer of an array of MENUIMAGEINFO struct .
  461. // nCount
  462. // [in] length of array pMenuImage.
  463. // hImageList
  464. // [in] imagelist used by the main menu to display normal item images.
  465. // hHotImageList
  466. // [in] imagelist used by the main menu to display hot item images.
  467. // hDisabledImagelist
  468. // [in] imagelist used by the main menu to display disabled item images.
  469. ///////////////////////////////////////////////////////////////////////////////////////////
  470. BOOL __stdcall TrackSkinPopupMenuEx( HMENU hMenu,
  471. LPCTSTR lpSkinName,
  472. UINT uFlags,
  473. int x,
  474. int y,
  475. HWND hWnd ,
  476. MENUIMAGEINFO* pMenuImage,
  477. UINT nCount ,
  478. HIMAGELIST hImageList ,
  479. HIMAGELIST hHotImageList,
  480. HIMAGELIST hDisabledImagelist );
  481. int __stdcall RedrawCaptionStatic( HWND hWnd , LPCTSTR lpName );
  482. DWORD __stdcall GetSkinMagicErrorCode();
  483. //menu function
  484. //Use these function to get and set skinned window's menu
  485. HMENU __stdcall GetSkinMenu( HWND hWnd );
  486. BOOL __stdcall SetSkinMenu( HWND hWnd , HMENU hMenu );
  487. //The state of caption button
  488. #define CPBS_HOVERED 0x00000000
  489. #define CPBS_PRESSED 0x00000001
  490. #define CPBS_DISABLED 0x00000002
  491. #define CPBS_NORMAL 0x00000003
  492. //////////////////////////////////////////////////////////////////////////////////////////////////
  493. //Function: GetCaptionButtonState
  494. // The GetCaptionBttonState function get captionbutton object's state.
  495. //
  496. //Parameters:
  497. // hWnd
  498. // [in] Handle to the window own the captionbutton.
  499. // lpName
  500. // [in] the captionbutton's name
  501. // pdwState
  502. // [out] the state of captionbutton.
  503. //
  504. //Return Values:
  505. // If the function success, the return value is nonzero
  506. // If the function fail, the return value is zero
  507. ///////////////////////////////////////////////////////////////////////////////////////////
  508. int __stdcall GetCaptionButtonState(HWND hWnd , LPCTSTR lpName , DWORD* pdwState );
  509. //////////////////////////////////////////////////////////////////////////////////////////////////
  510. //Function: SetCaptionButtonState
  511. // The SetCaptionBttonState function set captionbutton object's state.
  512. //
  513. //Parameters:
  514. // hWnd
  515. // [in] Handle to the window own the captionbutton.
  516. // lpName
  517. // [in] the captionbutton's name
  518. // dwState
  519. // [in] the state of captionbutton.
  520. //
  521. //Return Values:
  522. // If the function success, the return value is nonzero
  523. // If the function fail, the return value is zero
  524. ///////////////////////////////////////////////////////////////////////////////////////////
  525. int __stdcall SetCaptionButtonState(HWND hWnd , LPCTSTR lpName , DWORD dwState );
  526. ///////////////////////////////////////////////////////////////////////////////////////////
  527. int __stdcall SetSkinWindowAccelerator( HWND hWnd, HACCEL hAccTable );
  528. ////////////////////////////////////////////////////////////////////////////////////////////
  529. int __stdcall SetControlTooltip( HWND hWnd , LPCTSTR lpTooltip );
  530. int __stdcall SetCaptionButtonTooltip( HWND hWnd , LPCTSTR lpName , LPCTSTR lpTooltip );
  531. int __stdcall ShowTooltipPoint( HWND hWnd , LPCTSTR lpTooltip , LPPOINT lpPoint );
  532. int __stdcall HideTooltip();
  533. int __stdcall SetControlSkin( HWND hWnd , LPCTSTR szSkinName, LPCTSTR szOwnerSkinName );
  534. COLORREF __stdcall GetSkinSysColor( int nIndex );
  535. HBRUSH __stdcall GetSkinSysColorBrush( int nIndex );
  536. //
  537. int __stdcall ShowSkinObject( HWND hWnd , LPCTSTR szSkinObject , BOOL bVisible );
  538. int __stdcall SetSkinObjectText( HWND hWnd , LPCTSTR szSkinObject , LPCTSTR lpText );
  539. int __stdcall GetSkinObjectText( HWND hWnd , LPCTSTR szSkinObject , LPTSTR lpText , int nMaxCount );
  540. int __stdcall GetLibVersion( LPTSTR lpVersion );
  541. int __stdcall GetSkinClientRect( HWND hWnd, LPRECT lpRect );
  542. #define WM_CB_MOUSEMOVE WM_USER + 2001
  543. #define WM_CB_LBUTTONDOWN WM_USER + 2002
  544. #define WM_CB_RBUTTONDOWN WM_USER + 2003
  545. #define WM_CB_LBUTTONUP WM_USER + 2004
  546. #define WM_CB_RBUTTONUP WM_USER + 2005
  547. #define WM_CB_LBUTTONDBLCLK WM_USER + 2006
  548. #define WM_CB_MOUSELEAVE WM_USER + 2007
  549. #define WM_CB_NOTIFY WM_USER + 2008
  550. #define WM_PAINTCLIENT WM_USER + 2009
  551. //wParam hDC
  552. //lParam lpRect - the client rect
  553. HBITMAP __stdcall CreateBitmapFromSkinImage( LPCTSTR szSkinImageName );
  554. #pragma pack(pop)
  555. #endif