jwauxtheme.pas 67 KB

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