~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/winunits/jwauxtheme.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

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