jwauxtheme.pas 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792
  1. {******************************************************************************}
  2. { }
  3. { Visual Styles (Themes) API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: uxtheme.h, released June 2001. The original Pascal }
  9. { code is: UxTheme.pas, released July 2001. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. // $Id: JwaUxTheme.pas,v 1.9 2005/09/08 07:49:25 marquardt Exp $
  43. unit JwaUxTheme;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "uxtheme.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaWindows;
  52. type
  53. HIMAGELIST = Pointer; // TODO
  54. type
  55. HTHEME = HANDLE; // handle to a section of theme data for class
  56. {$EXTERNALSYM HTHEME}
  57. //---------------------------------------------------------------------------
  58. // NOTE: PartId's and StateId's used in the theme API are defined in the
  59. // hdr file <tmschema.h> using the TM_PART and TM_STATE macros. For
  60. // example, "TM_PART(BP, PUSHBUTTON)" defines the PartId "BP_PUSHBUTTON".
  61. //---------------------------------------------------------------------------
  62. // OpenThemeData() - Open the theme data for the specified HWND and
  63. // semi-colon separated list of class names.
  64. //
  65. // OpenThemeData() will try each class name, one at
  66. // a time, and use the first matching theme info
  67. // found. If a match is found, a theme handle
  68. // to the data is returned. If no match is found,
  69. // a "NULL" handle is returned.
  70. //
  71. // When the window is destroyed or a WM_THEMECHANGED
  72. // msg is received, "CloseThemeData()" should be
  73. // called to close the theme handle.
  74. //
  75. // hwnd - window handle of the control/window to be themed
  76. //
  77. // pszClassList - class name (or list of names) to match to theme data
  78. // section. if the list contains more than one name,
  79. // the names are tested one at a time for a match.
  80. // If a match is found, OpenThemeData() returns a
  81. // theme handle associated with the matching class.
  82. // This param is a list (instead of just a single
  83. // class name) to provide the class an opportunity
  84. // to get the "best" match between the class and
  85. // the current theme. For example, a button might
  86. // pass L"OkButton, Button" if its ID=ID_OK. If
  87. // the current theme has an entry for OkButton,
  88. // that will be used. Otherwise, we fall back on
  89. // the normal Button entry.
  90. //---------------------------------------------------------------------------
  91. function OpenThemeData(hwnd: HWND; pszClassList: LPCWSTR): HTHEME; stdcall;
  92. {$EXTERNALSYM OpenThemeData}
  93. //---------------------------------------------------------------------------
  94. // CloseTHemeData() - closes the theme data handle. This should be done
  95. // when the window being themed is destroyed or
  96. // whenever a WM_THEMECHANGED msg is received
  97. // (followed by an attempt to create a new Theme data
  98. // handle).
  99. //
  100. // hTheme - open theme data handle (returned from prior call
  101. // to OpenThemeData() API).
  102. //---------------------------------------------------------------------------
  103. function CloseThemeData(hTheme: HTHEME): HRESULT; stdcall;
  104. {$EXTERNALSYM CloseThemeData}
  105. //---------------------------------------------------------------------------
  106. // functions for basic drawing support
  107. //---------------------------------------------------------------------------
  108. // The following methods are the theme-aware drawing services.
  109. // Controls/Windows are defined in drawable "parts" by their author: a
  110. // parent part and 0 or more child parts. Each of the parts can be
  111. // described in "states" (ex: disabled, hot, pressed).
  112. //---------------------------------------------------------------------------
  113. // For the list of all themed classes and the definition of all
  114. // parts and states, see the file "tmschmea.h".
  115. //---------------------------------------------------------------------------
  116. // Each of the below methods takes a "iPartId" param to specify the
  117. // part and a "iStateId" to specify the state of the part.
  118. // "iStateId=0" refers to the root part. "iPartId" = "0" refers to
  119. // the root class.
  120. //-----------------------------------------------------------------------
  121. // Note: draw operations are always scaled to fit (and not to exceed)
  122. // the specified "Rect".
  123. //-----------------------------------------------------------------------
  124. //------------------------------------------------------------------------
  125. // DrawThemeBackground()
  126. // - draws the theme-specified border and fill for
  127. // the "iPartId" and "iStateId". This could be
  128. // based on a bitmap file, a border and fill, or
  129. // other image description.
  130. //
  131. // hTheme - theme data handle
  132. // hdc - HDC to draw into
  133. // iPartId - part number to draw
  134. // iStateId - state number (of the part) to draw
  135. // pRect - defines the size/location of the part
  136. // pClipRect - optional clipping rect (don't draw outside it)
  137. //------------------------------------------------------------------------
  138. function DrawThemeBackground(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  139. const pRect: RECT; pClipRect: PRECT): HRESULT; stdcall;
  140. {$EXTERNALSYM DrawThemeBackground}
  141. //---------------------------------------------------------------------------
  142. //----- DrawThemeText() flags ----
  143. const
  144. DTT_GRAYED = $1; // draw a grayed-out string
  145. {$EXTERNALSYM DTT_GRAYED}
  146. //-------------------------------------------------------------------------
  147. // DrawThemeText() - draws the text using the theme-specified
  148. // color and font for the "iPartId" and
  149. // "iStateId".
  150. //
  151. // hTheme - theme data handle
  152. // hdc - HDC to draw into
  153. // iPartId - part number to draw
  154. // iStateId - state number (of the part) to draw
  155. // pszText - actual text to draw
  156. // dwCharCount - number of chars to draw (-1 for all)
  157. // dwTextFlags - same as DrawText() "uFormat" param
  158. // dwTextFlags2 - additional drawing options
  159. // pRect - defines the size/location of the part
  160. //-------------------------------------------------------------------------
  161. function DrawThemeText(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  162. pszText: LPCWSTR; iCharCount: Integer; dwTextFlags, dwTextFlags2: DWORD;
  163. const pRect: RECT): HRESULT; stdcall;
  164. {$EXTERNALSYM DrawThemeText}
  165. //-------------------------------------------------------------------------
  166. // GetThemeBackgroundContentRect()
  167. // - gets the size of the content for the theme-defined
  168. // background. This is usually the area inside
  169. // the borders or Margins.
  170. //
  171. // hTheme - theme data handle
  172. // hdc - (optional) device content to be used for drawing
  173. // iPartId - part number to draw
  174. // iStateId - state number (of the part) to draw
  175. // pBoundingRect - the outer RECT of the part being drawn
  176. // pContentRect - RECT to receive the content area
  177. //-------------------------------------------------------------------------
  178. function GetThemeBackgroundContentRect(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  179. const pBoundingRect: RECT; pContentRect: PRECT): HRESULT; stdcall;
  180. {$EXTERNALSYM GetThemeBackgroundContentRect}
  181. //-------------------------------------------------------------------------
  182. // GetThemeBackgroundExtent() - calculates the size/location of the theme-
  183. // specified background based on the
  184. // "pContentRect".
  185. //
  186. // hTheme - theme data handle
  187. // hdc - (optional) device content to be used for drawing
  188. // iPartId - part number to draw
  189. // iStateId - state number (of the part) to draw
  190. // pContentRect - RECT that defines the content area
  191. // pBoundingRect - RECT to receive the overall size/location of part
  192. //-------------------------------------------------------------------------
  193. function GetThemeBackgroundExtent(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  194. const pContentRect: RECT; var pExtentRect: RECT): HRESULT; stdcall;
  195. {$EXTERNALSYM GetThemeBackgroundExtent}
  196. //-------------------------------------------------------------------------
  197. type
  198. THEMESIZE = (
  199. TS_MIN, // minimum size
  200. TS_TRUE, // size without stretching
  201. TS_DRAW); // size that theme mgr will use to draw part
  202. {$EXTERNALSYM THEMESIZE}
  203. TThemeSize = THEMESIZE;
  204. //-------------------------------------------------------------------------
  205. // GetThemePartSize() - returns the specified size of the theme part
  206. //
  207. // hTheme - theme data handle
  208. // hdc - HDC to select font into & measure against
  209. // iPartId - part number to retrieve size for
  210. // iStateId - state number (of the part)
  211. // prc - (optional) rect for part drawing destination
  212. // eSize - the type of size to be retreived
  213. // psz - receives the specified size of the part
  214. //-------------------------------------------------------------------------
  215. function GetThemePartSize(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  216. prc: PRECT; eSize: THEMESIZE; var psz: TSize): HRESULT; stdcall;
  217. {$EXTERNALSYM GetThemePartSize}
  218. //-------------------------------------------------------------------------
  219. // GetThemeTextExtent() - calculates the size/location of the specified
  220. // text when rendered in the Theme Font.
  221. //
  222. // hTheme - theme data handle
  223. // hdc - HDC to select font & measure into
  224. // iPartId - part number to draw
  225. // iStateId - state number (of the part)
  226. // pszText - the text to be measured
  227. // dwCharCount - number of chars to draw (-1 for all)
  228. // dwTextFlags - same as DrawText() "uFormat" param
  229. // pszBoundingRect - optional: to control layout of text
  230. // pszExtentRect - receives the RECT for text size/location
  231. //-------------------------------------------------------------------------
  232. function GetThemeTextExtent(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  233. pszText: LPCWSTR; iCharCount: Integer; dwTextFlags: DWORD; pBoundingRect: PRECT;
  234. var pExtentRect: RECT): HRESULT; stdcall;
  235. {$EXTERNALSYM GetThemeTextExtent}
  236. //-------------------------------------------------------------------------
  237. // GetThemeTextMetrics()
  238. // - returns info about the theme-specified font
  239. // for the part/state passed in.
  240. //
  241. // hTheme - theme data handle
  242. // hdc - optional: HDC for screen context
  243. // iPartId - part number to draw
  244. // iStateId - state number (of the part)
  245. // ptm - receives the font info
  246. //-------------------------------------------------------------------------
  247. function GetThemeTextMetrics(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  248. var ptm: TEXTMETRIC): HRESULT; stdcall;
  249. {$EXTERNALSYM GetThemeTextMetrics}
  250. //-------------------------------------------------------------------------
  251. // GetThemeBackgroundRegion()
  252. // - computes the region for a regular or partially
  253. // transparent theme-specified background that is
  254. // bound by the specified "pRect".
  255. // If the rectangle is empty, sets the HRGN to NULL
  256. // and return S_FALSE.
  257. //
  258. // hTheme - theme data handle
  259. // hdc - optional HDC to draw into (DPI scaling)
  260. // iPartId - part number to draw
  261. // iStateId - state number (of the part)
  262. // pRect - the RECT used to draw the part
  263. // pRegion - receives handle to calculated region
  264. //-------------------------------------------------------------------------
  265. function GetThemeBackgroundRegion(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  266. const pRect: RECT; var pRegion: HRGN): HRESULT; stdcall;
  267. {$EXTERNALSYM GetThemeBackgroundRegion}
  268. //-------------------------------------------------------------------------
  269. //----- HitTestThemeBackground, HitTestThemeBackgroundRegion flags ----
  270. // Theme background segment hit test flag (default). possible return values are:
  271. // HTCLIENT: hit test succeeded in the middle background segment
  272. // HTTOP, HTLEFT, HTTOPLEFT, etc: // hit test succeeded in the the respective theme background segment.
  273. const
  274. HTTB_BACKGROUNDSEG = $0000;
  275. {$EXTERNALSYM HTTB_BACKGROUNDSEG}
  276. // Fixed border hit test option. possible return values are:
  277. // HTCLIENT: hit test succeeded in the middle background segment
  278. // HTBORDER: hit test succeeded in any other background segment
  279. HTTB_FIXEDBORDER = $0002; // Return code may be either HTCLIENT or HTBORDER.
  280. {$EXTERNALSYM HTTB_FIXEDBORDER}
  281. // Caption hit test option. Possible return values are:
  282. // HTCAPTION: hit test succeeded in the top, top left, or top right background segments
  283. // HTNOWHERE or another return code, depending on absence or presence of accompanying flags, resp.
  284. HTTB_CAPTION = $0004;
  285. {$EXTERNALSYM HTTB_CAPTION}
  286. // Resizing border hit test flags. Possible return values are:
  287. // HTCLIENT: hit test succeeded in middle background segment
  288. // HTTOP, HTTOPLEFT, HTLEFT, HTRIGHT, etc: hit test succeeded in the respective system resizing zone
  289. // HTBORDER: hit test failed in middle segment and resizing zones, but succeeded in a background border segment
  290. HTTB_RESIZINGBORDER_LEFT = $0010; // Hit test left resizing border,
  291. {$EXTERNALSYM HTTB_RESIZINGBORDER_LEFT}
  292. HTTB_RESIZINGBORDER_TOP = $0020; // Hit test top resizing border
  293. {$EXTERNALSYM HTTB_RESIZINGBORDER_TOP}
  294. HTTB_RESIZINGBORDER_RIGHT = $0040; // Hit test right resizing border
  295. {$EXTERNALSYM HTTB_RESIZINGBORDER_RIGHT}
  296. HTTB_RESIZINGBORDER_BOTTOM = $0080; // Hit test bottom resizing border
  297. {$EXTERNALSYM HTTB_RESIZINGBORDER_BOTTOM}
  298. HTTB_RESIZINGBORDER = (HTTB_RESIZINGBORDER_LEFT or HTTB_RESIZINGBORDER_TOP or
  299. HTTB_RESIZINGBORDER_RIGHT or HTTB_RESIZINGBORDER_BOTTOM);
  300. {$EXTERNALSYM HTTB_RESIZINGBORDER}
  301. // Resizing border is specified as a template, not just window edges.
  302. // This option is mutually exclusive with HTTB_SYSTEMSIZINGWIDTH; HTTB_SIZINGTEMPLATE takes precedence
  303. HTTB_SIZINGTEMPLATE = $0100;
  304. {$EXTERNALSYM HTTB_SIZINGTEMPLATE}
  305. // Use system resizing border width rather than theme content margins.
  306. // This option is mutually exclusive with HTTB_SIZINGTEMPLATE, which takes precedence.
  307. HTTB_SYSTEMSIZINGMARGINS = $0200;
  308. {$EXTERNALSYM HTTB_SYSTEMSIZINGMARGINS}
  309. //-------------------------------------------------------------------------
  310. // HitTestThemeBackground()
  311. // - returns a HitTestCode (a subset of the values
  312. // returned by WM_NCHITTEST) for the point "ptTest"
  313. // within the theme-specified background
  314. // (bound by pRect). "pRect" and "ptTest" should
  315. // both be in the same coordinate system
  316. // (client, screen, etc).
  317. //
  318. // hTheme - theme data handle
  319. // hdc - HDC to draw into
  320. // iPartId - part number to test against
  321. // iStateId - state number (of the part)
  322. // pRect - the RECT used to draw the part
  323. // hrgn - optional region to use; must be in same coordinates as
  324. // - pRect and pTest.
  325. // ptTest - the hit point to be tested
  326. // dwOptions - HTTB_xxx constants
  327. // pwHitTestCode - receives the returned hit test code - one of:
  328. //
  329. // HTNOWHERE, HTLEFT, HTTOPLEFT, HTBOTTOMLEFT,
  330. // HTRIGHT, HTTOPRIGHT, HTBOTTOMRIGHT,
  331. // HTTOP, HTBOTTOM, HTCLIENT
  332. //-------------------------------------------------------------------------
  333. function HitTestThemeBackground(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  334. dwOptions: DWORD; const pRect: RECT; hrgn: HRGN; ptTest: POINT; var pwHitTestCode: WORD): HRESULT; stdcall;
  335. {$EXTERNALSYM HitTestThemeBackground}
  336. //------------------------------------------------------------------------
  337. // DrawThemeEdge() - Similar to the DrawEdge() API, but uses part colors
  338. // and is high-DPI aware
  339. // hTheme - theme data handle
  340. // hdc - HDC to draw into
  341. // iPartId - part number to draw
  342. // iStateId - state number of part
  343. // pDestRect - the RECT used to draw the line(s)
  344. // uEdge - Same as DrawEdge() API
  345. // uFlags - Same as DrawEdge() API
  346. // pContentRect - Receives the interior rect if (uFlags & BF_ADJUST)
  347. //------------------------------------------------------------------------
  348. function DrawThemeEdge(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  349. const pDestRect: RECT; uEdge, uFlags: UINT; pContentRect: PRECT): HRESULT; stdcall;
  350. {$EXTERNALSYM DrawThemeEdge}
  351. //------------------------------------------------------------------------
  352. // DrawThemeIcon() - draws an image within an imagelist based on
  353. // a (possible) theme-defined effect.
  354. //
  355. // hTheme - theme data handle
  356. // hdc - HDC to draw into
  357. // iPartId - part number to draw
  358. // iStateId - state number of part
  359. // pRect - the RECT to draw the image within
  360. // himl - handle to IMAGELIST
  361. // iImageIndex - index into IMAGELIST (which icon to draw)
  362. //------------------------------------------------------------------------
  363. function DrawThemeIcon(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer;
  364. const pRect: RECT; himl: HIMAGELIST; iImageIndex: Integer): HRESULT; stdcall;
  365. {$EXTERNALSYM DrawThemeIcon}
  366. //---------------------------------------------------------------------------
  367. // IsThemePartDefined() - returns TRUE if the theme has defined parameters
  368. // for the specified "iPartId" and "iStateId".
  369. //
  370. // hTheme - theme data handle
  371. // iPartId - part number to find definition for
  372. // iStateId - state number of part
  373. //---------------------------------------------------------------------------
  374. function IsThemePartDefined(hTheme: HTHEME; iPartId, iStateId: Integer): BOOL; stdcall;
  375. {$EXTERNALSYM IsThemePartDefined}
  376. //---------------------------------------------------------------------------
  377. // IsThemeBackgroundPartiallyTransparent()
  378. // - returns TRUE if the theme specified background for
  379. // the part/state has transparent pieces or
  380. // alpha-blended pieces.
  381. //
  382. // hTheme - theme data handle
  383. // iPartId - part number
  384. // iStateId - state number of part
  385. //---------------------------------------------------------------------------
  386. function IsThemeBackgroundPartiallyTransparent(hTheme: HTHEME; iPartId, iStateId: Integer): BOOL; stdcall;
  387. {$EXTERNALSYM IsThemeBackgroundPartiallyTransparent}
  388. //---------------------------------------------------------------------------
  389. // lower-level theme information services
  390. //---------------------------------------------------------------------------
  391. // The following methods are getter routines for each of the Theme Data types.
  392. // Controls/Windows are defined in drawable "parts" by their author: a
  393. // parent part and 0 or more child parts. Each of the parts can be
  394. // described in "states" (ex: disabled, hot, pressed).
  395. //---------------------------------------------------------------------------
  396. // Each of the below methods takes a "iPartId" param to specify the
  397. // part and a "iStateId" to specify the state of the part.
  398. // "iStateId=0" refers to the root part. "iPartId" = "0" refers to
  399. // the root class.
  400. //-----------------------------------------------------------------------
  401. // Each method also take a "iPropId" param because multiple instances of
  402. // the same primitive type can be defined in the theme schema.
  403. //-----------------------------------------------------------------------
  404. //-----------------------------------------------------------------------
  405. // GetThemeColor() - Get the value for the specified COLOR property
  406. //
  407. // hTheme - theme data handle
  408. // iPartId - part number
  409. // iStateId - state number of part
  410. // iPropId - the property number to get the value for
  411. // pColor - receives the value of the property
  412. //-----------------------------------------------------------------------
  413. function GetThemeColor(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  414. var pColor: COLORREF): HRESULT; stdcall;
  415. {$EXTERNALSYM GetThemeColor}
  416. //-----------------------------------------------------------------------
  417. // GetThemeMetric() - Get the value for the specified metric/size
  418. // property
  419. //
  420. // hTheme - theme data handle
  421. // hdc - (optional) hdc to be drawn into (DPI scaling)
  422. // iPartId - part number
  423. // iStateId - state number of part
  424. // iPropId - the property number to get the value for
  425. // piVal - receives the value of the property
  426. //-----------------------------------------------------------------------
  427. function GetThemeMetric(hTheme: HTHEME; hdc: HDC; iPartId, iStateId, iPropId: Integer;
  428. var piVal: Integer): HRESULT; stdcall;
  429. {$EXTERNALSYM GetThemeMetric}
  430. //-----------------------------------------------------------------------
  431. // GetThemeString() - Get the value for the specified string property
  432. //
  433. // hTheme - theme data handle
  434. // iPartId - part number
  435. // iStateId - state number of part
  436. // iPropId - the property number to get the value for
  437. // pszBuff - receives the string property value
  438. // cchMaxBuffChars - max. number of chars allowed in pszBuff
  439. //-----------------------------------------------------------------------
  440. function GetThemeString(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  441. pszBuff: LPWSTR; cchMaxBuffChars: Integer): HRESULT; stdcall;
  442. {$EXTERNALSYM GetThemeString}
  443. //-----------------------------------------------------------------------
  444. // GetThemeBool() - Get the value for the specified BOOL property
  445. //
  446. // hTheme - theme data handle
  447. // iPartId - part number
  448. // iStateId - state number of part
  449. // iPropId - the property number to get the value for
  450. // pfVal - receives the value of the property
  451. //-----------------------------------------------------------------------
  452. function GetThemeBool(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  453. var pfVal: BOOL): HRESULT; stdcall;
  454. {$EXTERNALSYM GetThemeBool}
  455. //-----------------------------------------------------------------------
  456. // GetThemeInt() - Get the value for the specified int property
  457. //
  458. // hTheme - theme data handle
  459. // iPartId - part number
  460. // iStateId - state number of part
  461. // iPropId - the property number to get the value for
  462. // piVal - receives the value of the property
  463. //-----------------------------------------------------------------------
  464. function GetThemeInt(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  465. var piVal: Integer): HRESULT; stdcall;
  466. {$EXTERNALSYM GetThemeInt}
  467. //-----------------------------------------------------------------------
  468. // GetThemeEnumValue() - Get the value for the specified ENUM property
  469. //
  470. // hTheme - theme data handle
  471. // iPartId - part number
  472. // iStateId - state number of part
  473. // iPropId - the property number to get the value for
  474. // piVal - receives the value of the enum (cast to int*)
  475. //-----------------------------------------------------------------------
  476. function GetThemeEnumValue(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  477. var piVal: Integer): HRESULT; stdcall;
  478. {$EXTERNALSYM GetThemeEnumValue}
  479. //-----------------------------------------------------------------------
  480. // GetThemePosition() - Get the value for the specified position
  481. // property
  482. //
  483. // hTheme - theme data handle
  484. // iPartId - part number
  485. // iStateId - state number of part
  486. // iPropId - the property number to get the value for
  487. // pPoint - receives the value of the position property
  488. //-----------------------------------------------------------------------
  489. function GetThemePosition(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  490. var pPoint: POINT): HRESULT; stdcall;
  491. {$EXTERNALSYM GetThemePosition}
  492. //-----------------------------------------------------------------------
  493. // GetThemeFont() - Get the value for the specified font property
  494. //
  495. // hTheme - theme data handle
  496. // hdc - (optional) hdc to be drawn to (DPI scaling)
  497. // iPartId - part number
  498. // iStateId - state number of part
  499. // iPropId - the property number to get the value for
  500. // pFont - receives the value of the LOGFONT property
  501. // (scaled for the current logical screen dpi)
  502. //-----------------------------------------------------------------------
  503. function GetThemeFont(hTheme: HTHEME; hdc: HDC; iPartId, iStateId, iPropId: Integer;
  504. var pFont: LOGFONT): HRESULT; stdcall;
  505. {$EXTERNALSYM GetThemeFont}
  506. //-----------------------------------------------------------------------
  507. // GetThemeRect() - Get the value for the specified RECT property
  508. //
  509. // hTheme - theme data handle
  510. // iPartId - part number
  511. // iStateId - state number of part
  512. // iPropId - the property number to get the value for
  513. // pRect - receives the value of the RECT property
  514. //-----------------------------------------------------------------------
  515. function GetThemeRect(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  516. var pRect: RECT): HRESULT; stdcall;
  517. {$EXTERNALSYM GetThemeRect}
  518. //-----------------------------------------------------------------------
  519. type
  520. _MARGINS = record
  521. cxLeftWidth: Integer; // width of left border that retains its size
  522. cxRightWidth: Integer; // width of right border that retains its size
  523. cyTopHeight: Integer; // height of top border that retains its size
  524. cyBottomHeight: Integer; // height of bottom border that retains its size
  525. end;
  526. {$EXTERNALSYM _MARGINS}
  527. MARGINS = _MARGINS;
  528. {$EXTERNALSYM MARGINS}
  529. PMARGINS = ^MARGINS;
  530. {$EXTERNALSYM PMARGINS}
  531. TMargins = MARGINS;
  532. //-----------------------------------------------------------------------
  533. // GetThemeMargins() - Get the value for the specified MARGINS property
  534. //
  535. // hTheme - theme data handle
  536. // hdc - (optional) hdc to be used for drawing
  537. // iPartId - part number
  538. // iStateId - state number of part
  539. // iPropId - the property number to get the value for
  540. // prc - RECT for area to be drawn into
  541. // pMargins - receives the value of the MARGINS property
  542. //-----------------------------------------------------------------------
  543. function GetThemeMargins(hTheme: HTHEME; hdc: HDC; iPartId, iStateId, iPropId: Integer;
  544. prc: PRECT; var pMargins: MARGINS): HRESULT; stdcall;
  545. {$EXTERNALSYM GetThemeMargins}
  546. //-----------------------------------------------------------------------
  547. const
  548. MAX_INTLIST_COUNT = 10;
  549. {$EXTERNALSYM MAX_INTLIST_COUNT}
  550. type
  551. _INTLIST = record
  552. iValueCount: Integer; // number of values in iValues
  553. iValues: array [0..MAX_INTLIST_COUNT - 1] of Integer;
  554. end;
  555. {$EXTERNALSYM _INTLIST}
  556. INTLIST = _INTLIST;
  557. {$EXTERNALSYM INTLIST}
  558. PINTLIST = ^INTLIST;
  559. {$EXTERNALSYM PINTLIST}
  560. TIntList = INTLIST;
  561. //-----------------------------------------------------------------------
  562. // GetThemeIntList() - Get the value for the specified INTLIST struct
  563. //
  564. // hTheme - theme data handle
  565. // iPartId - part number
  566. // iStateId - state number of part
  567. // iPropId - the property number to get the value for
  568. // pIntList - receives the value of the INTLIST property
  569. //-----------------------------------------------------------------------
  570. function GetThemeIntList(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  571. var pIntList: INTLIST): HRESULT; stdcall;
  572. {$EXTERNALSYM GetThemeIntList}
  573. //-----------------------------------------------------------------------
  574. type
  575. PROPERTYORIGIN = (
  576. PO_STATE, // property was found in the state section
  577. PO_PART, // property was found in the part section
  578. PO_CLASS, // property was found in the class section
  579. PO_GLOBAL, // property was found in [globals] section
  580. PO_NOTFOUND); // property was not found
  581. {$EXTERNALSYM PROPERTYORIGIN}
  582. TPropertyOrigin = PROPERTYORIGIN;
  583. //-----------------------------------------------------------------------
  584. // GetThemePropertyOrigin()
  585. // - searches for the specified theme property
  586. // and sets "pOrigin" to indicate where it was
  587. // found (or not found)
  588. //
  589. // hTheme - theme data handle
  590. // iPartId - part number
  591. // iStateId - state number of part
  592. // iPropId - the property number to search for
  593. // pOrigin - receives the value of the property origin
  594. //-----------------------------------------------------------------------
  595. function GetThemePropertyOrigin(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  596. var pOrigin: PROPERTYORIGIN): HRESULT; stdcall;
  597. {$EXTERNALSYM GetThemePropertyOrigin}
  598. //---------------------------------------------------------------------------
  599. // SetWindowTheme()
  600. // - redirects an existing Window to use a different
  601. // section of the current theme information than its
  602. // class normally asks for.
  603. //
  604. // hwnd - the handle of the window (cannot be NULL)
  605. //
  606. // pszSubAppName - app (group) name to use in place of the calling
  607. // app's name. If NULL, the actual calling app
  608. // name will be used.
  609. //
  610. // pszSubIdList - semicolon separated list of class Id names to
  611. // use in place of actual list passed by the
  612. // window's class. if NULL, the id list from the
  613. // calling class is used.
  614. //---------------------------------------------------------------------------
  615. // The Theme Manager will remember the "pszSubAppName" and the
  616. // "pszSubIdList" associations thru the lifetime of the window (even
  617. // if themes are subsequently changed). The window is sent a
  618. // "WM_THEMECHANGED" msg at the end of this call, so that the new
  619. // theme can be found and applied.
  620. //---------------------------------------------------------------------------
  621. // When "pszSubAppName" or "pszSubIdList" are NULL, the Theme Manager
  622. // removes the previously remember association. To turn off theme-ing for
  623. // the specified window, you can pass an empty string (L"") so it
  624. // won't match any section entries.
  625. //---------------------------------------------------------------------------
  626. function SetWindowTheme(hwnd: HWND; pszSubAppName: LPCWSTR; pszSubIdList: LPCWSTR): HRESULT; stdcall;
  627. {$EXTERNALSYM SetWindowTheme}
  628. //---------------------------------------------------------------------------
  629. // GetThemeFilename() - Get the value for the specified FILENAME property.
  630. //
  631. // hTheme - theme data handle
  632. // iPartId - part number
  633. // iStateId - state number of part
  634. // iPropId - the property number to search for
  635. // pszThemeFileName - output buffer to receive the filename
  636. // cchMaxBuffChars - the size of the return buffer, in chars
  637. //---------------------------------------------------------------------------
  638. function GetThemeFilename(hTheme: HTHEME; iPartId, iStateId, iPropId: Integer;
  639. pszThemeFileName: LPWSTR; cchMaxBuffChars: Integer): HRESULT; stdcall;
  640. {$EXTERNALSYM GetThemeFilename}
  641. //---------------------------------------------------------------------------
  642. // GetThemeSysColor() - Get the value of the specified System color.
  643. //
  644. // hTheme - the theme data handle. if non-NULL, will return
  645. // color from [SysMetrics] section of theme.
  646. // if NULL, will return the global system color.
  647. //
  648. // iColorId - the system color index defined in winuser.h
  649. //---------------------------------------------------------------------------
  650. function GetThemeSysColor(hTheme: HTHEME; iColorId: Integer): COLORREF; stdcall;
  651. {$EXTERNALSYM GetThemeSysColor}
  652. //---------------------------------------------------------------------------
  653. // GetThemeSysColorBrush()
  654. // - Get the brush for the specified System color.
  655. //
  656. // hTheme - the theme data handle. if non-NULL, will return
  657. // brush matching color from [SysMetrics] section of
  658. // theme. if NULL, will return the brush matching
  659. // global system color.
  660. //
  661. // iColorId - the system color index defined in winuser.h
  662. //---------------------------------------------------------------------------
  663. function GetThemeSysColorBrush(hTheme: HTHEME; iColorId: Integer): HBRUSH; stdcall;
  664. {$EXTERNALSYM GetThemeSysColorBrush}
  665. //---------------------------------------------------------------------------
  666. // GetThemeSysBool() - Get the boolean value of specified System metric.
  667. //
  668. // hTheme - the theme data handle. if non-NULL, will return
  669. // BOOL from [SysMetrics] section of theme.
  670. // if NULL, will return the specified system boolean.
  671. //
  672. // iBoolId - the TMT_XXX BOOL number (first BOOL
  673. // is TMT_FLATMENUS)
  674. //---------------------------------------------------------------------------
  675. function GetThemeSysBool(hTheme: HTHEME; iBoolId: Integer): BOOL; stdcall;
  676. {$EXTERNALSYM GetThemeSysBool}
  677. //---------------------------------------------------------------------------
  678. // GetThemeSysSize() - Get the value of the specified System size metric.
  679. // (scaled for the current logical screen dpi)
  680. //
  681. // hTheme - the theme data handle. if non-NULL, will return
  682. // size from [SysMetrics] section of theme.
  683. // if NULL, will return the global system metric.
  684. //
  685. // iSizeId - the following values are supported when
  686. // hTheme is non-NULL:
  687. //
  688. // SM_CXBORDER (border width)
  689. // SM_CXVSCROLL (scrollbar width)
  690. // SM_CYHSCROLL (scrollbar height)
  691. // SM_CXSIZE (caption width)
  692. // SM_CYSIZE (caption height)
  693. // SM_CXSMSIZE (small caption width)
  694. // SM_CYSMSIZE (small caption height)
  695. // SM_CXMENUSIZE (menubar width)
  696. // SM_CYMENUSIZE (menubar height)
  697. //
  698. // when hTheme is NULL, iSizeId is passed directly
  699. // to the GetSystemMetrics() function
  700. //---------------------------------------------------------------------------
  701. function GetThemeSysSize(hTheme: HTHEME; iSizeId: Integer): Integer; stdcall;
  702. {$EXTERNALSYM GetThemeSysSize}
  703. //---------------------------------------------------------------------------
  704. // GetThemeSysFont() - Get the LOGFONT for the specified System font.
  705. //
  706. // hTheme - the theme data handle. if non-NULL, will return
  707. // font from [SysMetrics] section of theme.
  708. // if NULL, will return the specified system font.
  709. //
  710. // iFontId - the TMT_XXX font number (first font
  711. // is TMT_CAPTIONFONT)
  712. //
  713. // plf - ptr to LOGFONT to receive the font value.
  714. // (scaled for the current logical screen dpi)
  715. //---------------------------------------------------------------------------
  716. function GetThemeSysFont(hTheme: HTHEME; iFontId: Integer; var plf: LOGFONT): HRESULT; stdcall;
  717. {$EXTERNALSYM GetThemeSysFont}
  718. //---------------------------------------------------------------------------
  719. // GetThemeSysString() - Get the value of specified System string metric.
  720. //
  721. // hTheme - the theme data handle (required)
  722. //
  723. // iStringId - must be one of the following values:
  724. //
  725. // TMT_CSSNAME
  726. // TMT_XMLNAME
  727. //
  728. // pszStringBuff - the buffer to receive the string value
  729. //
  730. // cchMaxStringChars - max. number of chars that pszStringBuff can hold
  731. //---------------------------------------------------------------------------
  732. function GetThemeSysString(hTheme: HTHEME; iStringId: Integer;
  733. pszStringBuff: LPWSTR; cchMaxStringChars: Integer): HRESULT; stdcall;
  734. {$EXTERNALSYM GetThemeSysString}
  735. //---------------------------------------------------------------------------
  736. // GetThemeSysInt() - Get the value of specified System int.
  737. //
  738. // hTheme - the theme data handle (required)
  739. //
  740. // iIntId - must be one of the following values:
  741. //
  742. // TMT_DPIX
  743. // TMT_DPIY
  744. // TMT_MINCOLORDEPTH
  745. //
  746. // piValue - ptr to int to receive value
  747. //---------------------------------------------------------------------------
  748. function GetThemeSysInt(hTheme: HTHEME; iIntId: Integer; var piValue: Integer): HRESULT; stdcall;
  749. {$EXTERNALSYM GetThemeSysInt}
  750. //---------------------------------------------------------------------------
  751. // IsThemeActive() - can be used to test if a system theme is active
  752. // for the current user session.
  753. //
  754. // use the API "IsAppThemed()" to test if a theme is
  755. // active for the calling process.
  756. //---------------------------------------------------------------------------
  757. function IsThemeActive: BOOL; stdcall;
  758. {$EXTERNALSYM IsThemeActive}
  759. //---------------------------------------------------------------------------
  760. // IsAppThemed() - returns TRUE if a theme is active and available to
  761. // the current process
  762. //---------------------------------------------------------------------------
  763. function IsAppThemed: BOOL; stdcall;
  764. {$EXTERNALSYM IsAppThemed}
  765. //---------------------------------------------------------------------------
  766. // GetWindowTheme() - if window is themed, returns its most recent
  767. // HTHEME from OpenThemeData() - otherwise, returns
  768. // NULL.
  769. //
  770. // hwnd - the window to get the HTHEME of
  771. //---------------------------------------------------------------------------
  772. function GetWindowTheme(hwnd: HWND): HTHEME; stdcall;
  773. {$EXTERNALSYM GetWindowTheme}
  774. //---------------------------------------------------------------------------
  775. // EnableThemeDialogTexture()
  776. //
  777. // - Enables/disables dialog background theme. This method can be used to
  778. // tailor dialog compatibility with child windows and controls that
  779. // may or may not coordinate the rendering of their client area backgrounds
  780. // with that of their parent dialog in a manner that supports seamless
  781. // background texturing.
  782. //
  783. // hdlg - the window handle of the target dialog
  784. // dwFlags - ETDT_ENABLE to enable the theme-defined dialog background texturing,
  785. // ETDT_DISABLE to disable background texturing,
  786. // ETDT_ENABLETAB to enable the theme-defined background
  787. // texturing using the Tab texture
  788. //---------------------------------------------------------------------------
  789. const
  790. ETDT_DISABLE = $00000001;
  791. {$EXTERNALSYM ETDT_DISABLE}
  792. ETDT_ENABLE = $00000002;
  793. {$EXTERNALSYM ETDT_ENABLE}
  794. ETDT_USETABTEXTURE = $00000004;
  795. {$EXTERNALSYM ETDT_USETABTEXTURE}
  796. ETDT_ENABLETAB = ETDT_ENABLE or ETDT_USETABTEXTURE;
  797. {$EXTERNALSYM ETDT_ENABLETAB}
  798. function EnableThemeDialogTexture(hwnd: HWND; dwFlags: DWORD): HRESULT; stdcall;
  799. {$EXTERNALSYM EnableThemeDialogTexture}
  800. //---------------------------------------------------------------------------
  801. // IsThemeDialogTextureEnabled()
  802. //
  803. // - Reports whether the dialog supports background texturing.
  804. //
  805. // hdlg - the window handle of the target dialog
  806. //---------------------------------------------------------------------------
  807. function IsThemeDialogTextureEnabled(hwnd: HWND): BOOL; stdcall;
  808. {$EXTERNALSYM IsThemeDialogTextureEnabled}
  809. //---------------------------------------------------------------------------
  810. //---- flags to control theming within an app ----
  811. const
  812. STAP_ALLOW_NONCLIENT = 1 shl 0;
  813. {$EXTERNALSYM STAP_ALLOW_NONCLIENT}
  814. STAP_ALLOW_CONTROLS = 1 shl 1;
  815. {$EXTERNALSYM STAP_ALLOW_CONTROLS}
  816. STAP_ALLOW_WEBCONTENT = 1 shl 2;
  817. {$EXTERNALSYM STAP_ALLOW_WEBCONTENT}
  818. //---------------------------------------------------------------------------
  819. // GetThemeAppProperties()
  820. // - returns the app property flags that control theming
  821. //---------------------------------------------------------------------------
  822. function GetThemeAppProperties: DWORD; stdcall;
  823. {$EXTERNALSYM GetThemeAppProperties}
  824. //---------------------------------------------------------------------------
  825. // SetThemeAppProperties()
  826. // - sets the flags that control theming within the app
  827. //
  828. // dwFlags - the flag values to be set
  829. //---------------------------------------------------------------------------
  830. procedure SetThemeAppProperties(dwFlags: DWORD); stdcall;
  831. {$EXTERNALSYM SetThemeAppProperties}
  832. //---------------------------------------------------------------------------
  833. // GetCurrentThemeName()
  834. // - Get the name of the current theme in-use.
  835. // Optionally, return the ColorScheme name and the
  836. // Size name of the theme.
  837. //
  838. // pszThemeFileName - receives the theme path & filename
  839. // cchMaxNameChars - max chars allowed in pszNameBuff
  840. //
  841. // pszColorBuff - (optional) receives the canonical color scheme name
  842. // (not the display name)
  843. // cchMaxColorChars - max chars allowed in pszColorBuff
  844. //
  845. // pszSizeBuff - (optional) receives the canonical size name
  846. // (not the display name)
  847. // cchMaxSizeChars - max chars allowed in pszSizeBuff
  848. //---------------------------------------------------------------------------
  849. function GetCurrentThemeName(pszThemeFileName: LPWSTR; cchMaxNameChars: Integer; pszColorBuff: LPWSTR;
  850. cchMaxColorChars: Integer; pszSizeBuff: LPWSTR; cchMaxSizeChars: Integer): HRESULT; stdcall;
  851. {$EXTERNALSYM GetCurrentThemeName}
  852. //---------------------------------------------------------------------------
  853. // GetThemeDocumentationProperty()
  854. // - Get the value for the specified property name from
  855. // the [documentation] section of the themes.ini file
  856. // for the specified theme. If the property has been
  857. // localized in the theme files string table, the
  858. // localized version of the property value is returned.
  859. //
  860. // pszThemeFileName - filename of the theme file to query
  861. // pszPropertyName - name of the string property to retreive a value for
  862. // pszValueBuff - receives the property string value
  863. // cchMaxValChars - max chars allowed in pszValueBuff
  864. //---------------------------------------------------------------------------
  865. const
  866. SZ_THDOCPROP_DISPLAYNAME = WideString('DisplayName');
  867. {$EXTERNALSYM SZ_THDOCPROP_DISPLAYNAME}
  868. SZ_THDOCPROP_CANONICALNAME = WideString('ThemeName');
  869. {$EXTERNALSYM SZ_THDOCPROP_CANONICALNAME}
  870. SZ_THDOCPROP_TOOLTIP = WideString('ToolTip');
  871. {$EXTERNALSYM SZ_THDOCPROP_TOOLTIP}
  872. SZ_THDOCPROP_AUTHOR = WideString('author');
  873. {$EXTERNALSYM SZ_THDOCPROP_AUTHOR}
  874. function GetThemeDocumentationProperty(pszThemeName, pszPropertyName: LPCWSTR;
  875. pszValueBuff: LPWSTR; cchMaxValChars: Integer): HRESULT; stdcall;
  876. {$EXTERNALSYM GetThemeDocumentationProperty}
  877. //---------------------------------------------------------------------------
  878. // Theme API Error Handling
  879. //
  880. // All functions in the Theme API not returning an HRESULT (THEMEAPI_)
  881. // use the WIN32 function "SetLastError()" to record any call failures.
  882. //
  883. // To retreive the error code of the last failure on the
  884. // current thread for these type of API's, use the WIN32 function
  885. // "GetLastError()".
  886. //
  887. // All Theme API error codes (HRESULT's and GetLastError() values)
  888. // should be normal win32 errors which can be formatted into
  889. // strings using the Win32 API FormatMessage().
  890. //---------------------------------------------------------------------------
  891. //---------------------------------------------------------------------------
  892. // DrawThemeParentBackground()
  893. // - used by partially-transparent or alpha-blended
  894. // child controls to draw the part of their parent
  895. // that they appear in front of.
  896. //
  897. // hwnd - handle of the child control
  898. // hdc - hdc of the child control
  899. // prc - (optional) rect that defines the area to be
  900. // drawn (CHILD coordinates)
  901. //---------------------------------------------------------------------------
  902. function DrawThemeParentBackground(hwnd: HWND; hdc: HDC; prc: PRECT): HRESULT; stdcall;
  903. {$EXTERNALSYM DrawThemeParentBackground}
  904. //---------------------------------------------------------------------------
  905. // EnableTheming() - enables or disables themeing for the current user
  906. // in the current and future sessions.
  907. //
  908. // fEnable - if FALSE, disable theming & turn themes off.
  909. // - if TRUE, enable themeing and, if user previously
  910. // had a theme active, make it active now.
  911. //---------------------------------------------------------------------------
  912. function EnableTheming(fEnable: BOOL): HRESULT; stdcall;
  913. {$EXTERNALSYM EnableTheming}
  914. //------------------------------------------------------------------------
  915. //---- bits used in dwFlags of DTBGOPTS ----
  916. const
  917. DTBG_CLIPRECT = $00000001; // rcClip has been specified
  918. {$EXTERNALSYM DTBG_CLIPRECT}
  919. DTBG_DRAWSOLID = $00000002; // draw transparent/alpha images as solid
  920. {$EXTERNALSYM DTBG_DRAWSOLID}
  921. DTBG_OMITBORDER = $00000004; // don't draw border of part
  922. {$EXTERNALSYM DTBG_OMITBORDER}
  923. DTBG_OMITCONTENT = $00000008; // don't draw content area of part
  924. {$EXTERNALSYM DTBG_OMITCONTENT}
  925. DTBG_COMPUTINGREGION = $00000010; // TRUE if calling to compute region
  926. {$EXTERNALSYM DTBG_COMPUTINGREGION}
  927. DTBG_MIRRORDC = $00000020; // assume the hdc is mirrorred and
  928. // flip images as appropriate (currently
  929. // only supported for bgtype=imagefile)
  930. {$EXTERNALSYM DTBG_MIRRORDC}
  931. //------------------------------------------------------------------------
  932. type
  933. _DTBGOPTS = record
  934. dwSize: DWORD; // size of the struct
  935. dwFlags: DWORD; // which options have been specified
  936. rcClip: RECT; // clipping rectangle
  937. end;
  938. {$EXTERNALSYM _DTBGOPTS}
  939. DTBGOPTS = _DTBGOPTS;
  940. {$EXTERNALSYM DTBGOPTS}
  941. PDTBGOPTS = ^DTBGOPTS;
  942. TDtbgOpts = DTBGOPTS;
  943. //------------------------------------------------------------------------
  944. // DrawThemeBackgroundEx()
  945. // - draws the theme-specified border and fill for
  946. // the "iPartId" and "iStateId". This could be
  947. // based on a bitmap file, a border and fill, or
  948. // other image description. NOTE: This will be
  949. // merged back into DrawThemeBackground() after
  950. // BETA 2.
  951. //
  952. // hTheme - theme data handle
  953. // hdc - HDC to draw into
  954. // iPartId - part number to draw
  955. // iStateId - state number (of the part) to draw
  956. // pRect - defines the size/location of the part
  957. // pOptions - ptr to optional params
  958. //------------------------------------------------------------------------
  959. function DrawThemeBackgroundEx(hTheme: HTHEME; hdc: HDC; iPartId, iStateId: Integer; pRect: LPRECT; pOptions: PDTBGOPTS): HRESULT; stdcall;
  960. {$EXTERNALSYM DrawThemeBackgroundEx}
  961. implementation
  962. uses
  963. JwaWinDLLNames;
  964. {$IFDEF DYNAMIC_LINK}
  965. var
  966. _OpenThemeData: Pointer;
  967. function OpenThemeData;
  968. begin
  969. GetProcedureAddress(_OpenThemeData, themelib, 'OpenThemeData');
  970. asm
  971. MOV ESP, EBP
  972. POP EBP
  973. JMP [_OpenThemeData]
  974. end;
  975. end;
  976. var
  977. _CloseThemeData: Pointer;
  978. function CloseThemeData;
  979. begin
  980. GetProcedureAddress(_CloseThemeData, themelib, 'CloseThemeData');
  981. asm
  982. MOV ESP, EBP
  983. POP EBP
  984. JMP [_CloseThemeData]
  985. end;
  986. end;
  987. var
  988. _DrawThemeBackground: Pointer;
  989. function DrawThemeBackground;
  990. begin
  991. GetProcedureAddress(_DrawThemeBackground, themelib, 'DrawThemeBackground');
  992. asm
  993. MOV ESP, EBP
  994. POP EBP
  995. JMP [_DrawThemeBackground]
  996. end;
  997. end;
  998. var
  999. _DrawThemeText: Pointer;
  1000. function DrawThemeText;
  1001. begin
  1002. GetProcedureAddress(_DrawThemeText, themelib, 'DrawThemeText');
  1003. asm
  1004. MOV ESP, EBP
  1005. POP EBP
  1006. JMP [_DrawThemeText]
  1007. end;
  1008. end;
  1009. var
  1010. _GetThemeBackgroundContentRect: Pointer;
  1011. function GetThemeBackgroundContentRect;
  1012. begin
  1013. GetProcedureAddress(_GetThemeBackgroundContentRect, themelib, 'GetThemeBackgroundContentRect');
  1014. asm
  1015. MOV ESP, EBP
  1016. POP EBP
  1017. JMP [_GetThemeBackgroundContentRect]
  1018. end;
  1019. end;
  1020. var
  1021. _GetThemeBackgroundExtent: Pointer;
  1022. function GetThemeBackgroundExtent;
  1023. begin
  1024. GetProcedureAddress(_GetThemeBackgroundExtent, themelib, 'GetThemeBackgroundContentRect');
  1025. asm
  1026. MOV ESP, EBP
  1027. POP EBP
  1028. JMP [_GetThemeBackgroundExtent]
  1029. end;
  1030. end;
  1031. var
  1032. _GetThemePartSize: Pointer;
  1033. function GetThemePartSize;
  1034. begin
  1035. GetProcedureAddress(_GetThemePartSize, themelib, 'GetThemePartSize');
  1036. asm
  1037. MOV ESP, EBP
  1038. POP EBP
  1039. JMP [_GetThemePartSize]
  1040. end;
  1041. end;
  1042. var
  1043. _GetThemeTextExtent: Pointer;
  1044. function GetThemeTextExtent;
  1045. begin
  1046. GetProcedureAddress(_GetThemeTextExtent, themelib, 'GetThemeTextExtent');
  1047. asm
  1048. MOV ESP, EBP
  1049. POP EBP
  1050. JMP [_GetThemeTextExtent]
  1051. end;
  1052. end;
  1053. var
  1054. _GetThemeTextMetrics: Pointer;
  1055. function GetThemeTextMetrics;
  1056. begin
  1057. GetProcedureAddress(_GetThemeTextMetrics, themelib, 'GetThemeTextMetrics');
  1058. asm
  1059. MOV ESP, EBP
  1060. POP EBP
  1061. JMP [_GetThemeTextMetrics]
  1062. end;
  1063. end;
  1064. var
  1065. _GetThemeBackgroundRegion: Pointer;
  1066. function GetThemeBackgroundRegion;
  1067. begin
  1068. GetProcedureAddress(_GetThemeBackgroundRegion, themelib, 'GetThemeBackgroundRegion');
  1069. asm
  1070. MOV ESP, EBP
  1071. POP EBP
  1072. JMP [_GetThemeBackgroundRegion]
  1073. end;
  1074. end;
  1075. var
  1076. _HitTestThemeBackground: Pointer;
  1077. function HitTestThemeBackground;
  1078. begin
  1079. GetProcedureAddress(_HitTestThemeBackground, themelib, 'HitTestThemeBackground');
  1080. asm
  1081. MOV ESP, EBP
  1082. POP EBP
  1083. JMP [_HitTestThemeBackground]
  1084. end;
  1085. end;
  1086. var
  1087. _DrawThemeEdge: Pointer;
  1088. function DrawThemeEdge;
  1089. begin
  1090. GetProcedureAddress(_DrawThemeEdge, themelib, 'DrawThemeEdge');
  1091. asm
  1092. MOV ESP, EBP
  1093. POP EBP
  1094. JMP [_DrawThemeEdge]
  1095. end;
  1096. end;
  1097. var
  1098. _DrawThemeIcon: Pointer;
  1099. function DrawThemeIcon;
  1100. begin
  1101. GetProcedureAddress(_DrawThemeIcon, themelib, 'DrawThemeIcon');
  1102. asm
  1103. MOV ESP, EBP
  1104. POP EBP
  1105. JMP [_DrawThemeIcon]
  1106. end;
  1107. end;
  1108. var
  1109. _IsThemePartDefined: Pointer;
  1110. function IsThemePartDefined;
  1111. begin
  1112. GetProcedureAddress(_IsThemePartDefined, themelib, 'IsThemePartDefined');
  1113. asm
  1114. MOV ESP, EBP
  1115. POP EBP
  1116. JMP [_IsThemePartDefined]
  1117. end;
  1118. end;
  1119. var
  1120. _IsThemeBackgroundPartialTrans: Pointer;
  1121. function IsThemeBackgroundPartiallyTransparent;
  1122. begin
  1123. GetProcedureAddress(_IsThemeBackgroundPartialTrans, themelib, 'IsThemeBackgroundPartiallyTransparent');
  1124. asm
  1125. MOV ESP, EBP
  1126. POP EBP
  1127. JMP [_IsThemeBackgroundPartialTrans]
  1128. end;
  1129. end;
  1130. var
  1131. _GetThemeColor: Pointer;
  1132. function GetThemeColor;
  1133. begin
  1134. GetProcedureAddress(_GetThemeColor, themelib, 'GetThemeColor');
  1135. asm
  1136. MOV ESP, EBP
  1137. POP EBP
  1138. JMP [_GetThemeColor]
  1139. end;
  1140. end;
  1141. var
  1142. _GetThemeMetric: Pointer;
  1143. function GetThemeMetric;
  1144. begin
  1145. GetProcedureAddress(_GetThemeMetric, themelib, 'GetThemeMetric');
  1146. asm
  1147. MOV ESP, EBP
  1148. POP EBP
  1149. JMP [_GetThemeMetric]
  1150. end;
  1151. end;
  1152. var
  1153. _GetThemeString: Pointer;
  1154. function GetThemeString;
  1155. begin
  1156. GetProcedureAddress(_GetThemeString, themelib, 'GetThemeString');
  1157. asm
  1158. MOV ESP, EBP
  1159. POP EBP
  1160. JMP [_GetThemeString]
  1161. end;
  1162. end;
  1163. var
  1164. _GetThemeBool: Pointer;
  1165. function GetThemeBool;
  1166. begin
  1167. GetProcedureAddress(_GetThemeBool, themelib, 'GetThemeBool');
  1168. asm
  1169. MOV ESP, EBP
  1170. POP EBP
  1171. JMP [_GetThemeBool]
  1172. end;
  1173. end;
  1174. var
  1175. _GetThemeInt: Pointer;
  1176. function GetThemeInt;
  1177. begin
  1178. GetProcedureAddress(_GetThemeInt, themelib, 'GetThemeInt');
  1179. asm
  1180. MOV ESP, EBP
  1181. POP EBP
  1182. JMP [_GetThemeInt]
  1183. end;
  1184. end;
  1185. var
  1186. _GetThemeEnumValue: Pointer;
  1187. function GetThemeEnumValue;
  1188. begin
  1189. GetProcedureAddress(_GetThemeEnumValue, themelib, 'GetThemeEnumValue');
  1190. asm
  1191. MOV ESP, EBP
  1192. POP EBP
  1193. JMP [_GetThemeEnumValue]
  1194. end;
  1195. end;
  1196. var
  1197. _GetThemePosition: Pointer;
  1198. function GetThemePosition;
  1199. begin
  1200. GetProcedureAddress(_GetThemePosition, themelib, 'GetThemePosition');
  1201. asm
  1202. MOV ESP, EBP
  1203. POP EBP
  1204. JMP [_GetThemePosition]
  1205. end;
  1206. end;
  1207. var
  1208. _GetThemeFont: Pointer;
  1209. function GetThemeFont;
  1210. begin
  1211. GetProcedureAddress(_GetThemeFont, themelib, 'GetThemeFont');
  1212. asm
  1213. MOV ESP, EBP
  1214. POP EBP
  1215. JMP [_GetThemeFont]
  1216. end;
  1217. end;
  1218. var
  1219. _GetThemeRect: Pointer;
  1220. function GetThemeRect;
  1221. begin
  1222. GetProcedureAddress(_GetThemeRect, themelib, 'GetThemeRect');
  1223. asm
  1224. MOV ESP, EBP
  1225. POP EBP
  1226. JMP [_GetThemeRect]
  1227. end;
  1228. end;
  1229. var
  1230. _GetThemeMargins: Pointer;
  1231. function GetThemeMargins;
  1232. begin
  1233. GetProcedureAddress(_GetThemeMargins, themelib, 'GetThemeMargins');
  1234. asm
  1235. MOV ESP, EBP
  1236. POP EBP
  1237. JMP [_GetThemeMargins]
  1238. end;
  1239. end;
  1240. var
  1241. _GetThemeIntList: Pointer;
  1242. function GetThemeIntList;
  1243. begin
  1244. GetProcedureAddress(_GetThemeIntList, themelib, 'GetThemeIntList');
  1245. asm
  1246. MOV ESP, EBP
  1247. POP EBP
  1248. JMP [_GetThemeIntList]
  1249. end;
  1250. end;
  1251. var
  1252. _GetThemePropertyOrigin: Pointer;
  1253. function GetThemePropertyOrigin;
  1254. begin
  1255. GetProcedureAddress(_GetThemePropertyOrigin, themelib, 'GetThemePropertyOrigin');
  1256. asm
  1257. MOV ESP, EBP
  1258. POP EBP
  1259. JMP [_GetThemePropertyOrigin]
  1260. end;
  1261. end;
  1262. var
  1263. _SetWindowTheme: Pointer;
  1264. function SetWindowTheme;
  1265. begin
  1266. GetProcedureAddress(_SetWindowTheme, themelib, 'SetWindowTheme');
  1267. asm
  1268. MOV ESP, EBP
  1269. POP EBP
  1270. JMP [_SetWindowTheme]
  1271. end;
  1272. end;
  1273. var
  1274. _GetThemeFilename: Pointer;
  1275. function GetThemeFilename;
  1276. begin
  1277. GetProcedureAddress(_GetThemeFilename, themelib, 'GetThemeFilename');
  1278. asm
  1279. MOV ESP, EBP
  1280. POP EBP
  1281. JMP [_GetThemeFilename]
  1282. end;
  1283. end;
  1284. var
  1285. _GetThemeSysColor: Pointer;
  1286. function GetThemeSysColor;
  1287. begin
  1288. GetProcedureAddress(_GetThemeSysColor, themelib, 'GetThemeSysColor');
  1289. asm
  1290. MOV ESP, EBP
  1291. POP EBP
  1292. JMP [_GetThemeSysColor]
  1293. end;
  1294. end;
  1295. var
  1296. _GetThemeSysColorBrush: Pointer;
  1297. function GetThemeSysColorBrush;
  1298. begin
  1299. GetProcedureAddress(_GetThemeSysColorBrush, themelib, 'GetThemeSysColorBrush');
  1300. asm
  1301. MOV ESP, EBP
  1302. POP EBP
  1303. JMP [_GetThemeSysColorBrush]
  1304. end;
  1305. end;
  1306. var
  1307. _GetThemeSysBool: Pointer;
  1308. function GetThemeSysBool;
  1309. begin
  1310. GetProcedureAddress(_GetThemeSysBool, themelib, 'GetThemeSysBool');
  1311. asm
  1312. MOV ESP, EBP
  1313. POP EBP
  1314. JMP [_GetThemeSysBool]
  1315. end;
  1316. end;
  1317. var
  1318. _GetThemeSysSize: Pointer;
  1319. function GetThemeSysSize;
  1320. begin
  1321. GetProcedureAddress(_GetThemeSysSize, themelib, 'GetThemeSysSize');
  1322. asm
  1323. MOV ESP, EBP
  1324. POP EBP
  1325. JMP [_GetThemeSysSize]
  1326. end;
  1327. end;
  1328. var
  1329. _GetThemeSysFont: Pointer;
  1330. function GetThemeSysFont;
  1331. begin
  1332. GetProcedureAddress(_GetThemeSysFont, themelib, 'GetThemeSysFont');
  1333. asm
  1334. MOV ESP, EBP
  1335. POP EBP
  1336. JMP [_GetThemeSysFont]
  1337. end;
  1338. end;
  1339. var
  1340. _GetThemeSysString: Pointer;
  1341. function GetThemeSysString;
  1342. begin
  1343. GetProcedureAddress(_GetThemeSysString, themelib, 'GetThemeSysString');
  1344. asm
  1345. MOV ESP, EBP
  1346. POP EBP
  1347. JMP [_GetThemeSysString]
  1348. end;
  1349. end;
  1350. var
  1351. _GetThemeSysInt: Pointer;
  1352. function GetThemeSysInt;
  1353. begin
  1354. GetProcedureAddress(_GetThemeSysInt, themelib, 'GetThemeSysInt');
  1355. asm
  1356. MOV ESP, EBP
  1357. POP EBP
  1358. JMP [_GetThemeSysInt]
  1359. end;
  1360. end;
  1361. var
  1362. _IsThemeActive: Pointer;
  1363. function IsThemeActive;
  1364. begin
  1365. GetProcedureAddress(_IsThemeActive, themelib, 'IsThemeActive');
  1366. asm
  1367. MOV ESP, EBP
  1368. POP EBP
  1369. JMP [_IsThemeActive]
  1370. end;
  1371. end;
  1372. var
  1373. _IsAppThemed: Pointer;
  1374. function IsAppThemed;
  1375. begin
  1376. GetProcedureAddress(_IsAppThemed, themelib, 'IsAppThemed');
  1377. asm
  1378. MOV ESP, EBP
  1379. POP EBP
  1380. JMP [_IsAppThemed]
  1381. end;
  1382. end;
  1383. var
  1384. _GetWindowTheme: Pointer;
  1385. function GetWindowTheme;
  1386. begin
  1387. GetProcedureAddress(_GetWindowTheme, themelib, 'GetWindowTheme');
  1388. asm
  1389. MOV ESP, EBP
  1390. POP EBP
  1391. JMP [_GetWindowTheme]
  1392. end;
  1393. end;
  1394. var
  1395. _EnableThemeDialogTexture: Pointer;
  1396. function EnableThemeDialogTexture;
  1397. begin
  1398. GetProcedureAddress(_EnableThemeDialogTexture, themelib, 'EnableThemeDialogTexture');
  1399. asm
  1400. MOV ESP, EBP
  1401. POP EBP
  1402. JMP [_EnableThemeDialogTexture]
  1403. end;
  1404. end;
  1405. var
  1406. _IsThemeDialogTextureEnabled: Pointer;
  1407. function IsThemeDialogTextureEnabled;
  1408. begin
  1409. GetProcedureAddress(_IsThemeDialogTextureEnabled, themelib, 'IsThemeDialogTextureEnabled');
  1410. asm
  1411. MOV ESP, EBP
  1412. POP EBP
  1413. JMP [_IsThemeDialogTextureEnabled]
  1414. end;
  1415. end;
  1416. var
  1417. _GetThemeAppProperties: Pointer;
  1418. function GetThemeAppProperties;
  1419. begin
  1420. GetProcedureAddress(_GetThemeAppProperties, themelib, 'GetThemeAppProperties');
  1421. asm
  1422. MOV ESP, EBP
  1423. POP EBP
  1424. JMP [_GetThemeAppProperties]
  1425. end;
  1426. end;
  1427. var
  1428. _SetThemeAppProperties: Pointer;
  1429. procedure SetThemeAppProperties;
  1430. begin
  1431. GetProcedureAddress(_SetThemeAppProperties, themelib, 'SetThemeAppProperties');
  1432. asm
  1433. MOV ESP, EBP
  1434. POP EBP
  1435. JMP [_SetThemeAppProperties]
  1436. end;
  1437. end;
  1438. var
  1439. _GetCurrentThemeName: Pointer;
  1440. function GetCurrentThemeName;
  1441. begin
  1442. GetProcedureAddress(_GetCurrentThemeName, themelib, 'GetCurrentThemeName');
  1443. asm
  1444. MOV ESP, EBP
  1445. POP EBP
  1446. JMP [_GetCurrentThemeName]
  1447. end;
  1448. end;
  1449. var
  1450. _GetThemeDocumentationProperty: Pointer;
  1451. function GetThemeDocumentationProperty;
  1452. begin
  1453. GetProcedureAddress(_GetThemeDocumentationProperty, themelib, 'GetThemeDocumentationProperty');
  1454. asm
  1455. MOV ESP, EBP
  1456. POP EBP
  1457. JMP [_GetThemeDocumentationProperty]
  1458. end;
  1459. end;
  1460. var
  1461. _DrawThemeParentBackground: Pointer;
  1462. function DrawThemeParentBackground;
  1463. begin
  1464. GetProcedureAddress(_DrawThemeParentBackground, themelib, 'DrawThemeParentBackground');
  1465. asm
  1466. MOV ESP, EBP
  1467. POP EBP
  1468. JMP [_DrawThemeParentBackground]
  1469. end;
  1470. end;
  1471. var
  1472. _EnableTheming: Pointer;
  1473. function EnableTheming;
  1474. begin
  1475. GetProcedureAddress(_EnableTheming, themelib, 'EnableTheming');
  1476. asm
  1477. MOV ESP, EBP
  1478. POP EBP
  1479. JMP [_EnableTheming]
  1480. end;
  1481. end;
  1482. var
  1483. _DrawThemeBackgroundEx: Pointer;
  1484. function DrawThemeBackgroundEx;
  1485. begin
  1486. GetProcedureAddress(_DrawThemeBackgroundEx, themelib, 'DrawThemeBackgroundEx');
  1487. asm
  1488. MOV ESP, EBP
  1489. POP EBP
  1490. JMP [_DrawThemeBackgroundEx]
  1491. end;
  1492. end;
  1493. {$ELSE}
  1494. function OpenThemeData; external themelib name 'OpenThemeData';
  1495. function CloseThemeData; external themelib name 'CloseThemeData';
  1496. function DrawThemeBackground; external themelib name 'DrawThemeBackground';
  1497. function DrawThemeText; external themelib name 'DrawThemeText';
  1498. function GetThemeBackgroundContentRect; external themelib name 'GetThemeBackgroundContentRect';
  1499. function GetThemeBackgroundExtent; external themelib name 'GetThemeBackgroundContentRect';
  1500. function GetThemePartSize; external themelib name 'GetThemePartSize';
  1501. function GetThemeTextExtent; external themelib name 'GetThemeTextExtent';
  1502. function GetThemeTextMetrics; external themelib name 'GetThemeTextMetrics';
  1503. function GetThemeBackgroundRegion; external themelib name 'GetThemeBackgroundRegion';
  1504. function HitTestThemeBackground; external themelib name 'HitTestThemeBackground';
  1505. function DrawThemeEdge; external themelib name 'DrawThemeEdge';
  1506. function DrawThemeIcon; external themelib name 'DrawThemeIcon';
  1507. function IsThemePartDefined; external themelib name 'IsThemePartDefined';
  1508. function IsThemeBackgroundPartiallyTransparent; external themelib name 'IsThemeBackgroundPartiallyTransparent';
  1509. function GetThemeColor; external themelib name 'GetThemeColor';
  1510. function GetThemeMetric; external themelib name 'GetThemeMetric';
  1511. function GetThemeString; external themelib name 'GetThemeString';
  1512. function GetThemeBool; external themelib name 'GetThemeBool';
  1513. function GetThemeInt; external themelib name 'GetThemeInt';
  1514. function GetThemeEnumValue; external themelib name 'GetThemeEnumValue';
  1515. function GetThemePosition; external themelib name 'GetThemePosition';
  1516. function GetThemeFont; external themelib name 'GetThemeFont';
  1517. function GetThemeRect; external themelib name 'GetThemeRect';
  1518. function GetThemeMargins; external themelib name 'GetThemeMargins';
  1519. function GetThemeIntList; external themelib name 'GetThemeIntList';
  1520. function GetThemePropertyOrigin; external themelib name 'GetThemePropertyOrigin';
  1521. function SetWindowTheme; external themelib name 'SetWindowTheme';
  1522. function GetThemeFilename; external themelib name 'GetThemeFilename';
  1523. function GetThemeSysColor; external themelib name 'GetThemeSysColor';
  1524. function GetThemeSysColorBrush; external themelib name 'GetThemeSysColorBrush';
  1525. function GetThemeSysBool; external themelib name 'GetThemeSysBool';
  1526. function GetThemeSysSize; external themelib name 'GetThemeSysSize';
  1527. function GetThemeSysFont; external themelib name 'GetThemeSysFont';
  1528. function GetThemeSysString; external themelib name 'GetThemeSysString';
  1529. function GetThemeSysInt; external themelib name 'GetThemeSysInt';
  1530. function IsThemeActive; external themelib name 'IsThemeActive';
  1531. function IsAppThemed; external themelib name 'IsAppThemed';
  1532. function GetWindowTheme; external themelib name 'GetWindowTheme';
  1533. function EnableThemeDialogTexture; external themelib name 'EnableThemeDialogTexture';
  1534. function IsThemeDialogTextureEnabled; external themelib name 'IsThemeDialogTextureEnabled';
  1535. function GetThemeAppProperties; external themelib name 'GetThemeAppProperties';
  1536. procedure SetThemeAppProperties; external themelib name 'SetThemeAppProperties';
  1537. function GetCurrentThemeName; external themelib name 'GetCurrentThemeName';
  1538. function GetThemeDocumentationProperty; external themelib name 'GetThemeDocumentationProperty';
  1539. function DrawThemeParentBackground; external themelib name 'DrawThemeParentBackground';
  1540. function EnableTheming; external themelib name 'EnableTheming';
  1541. function DrawThemeBackgroundEx; external themelib name 'DrawThemeBackgroundEx';
  1542. {$ENDIF DYNAMIC_LINK}
  1543. end.