diff options
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/thmutil.h')
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/inc/thmutil.h | 765 |
1 files changed, 765 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h b/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h new file mode 100644 index 00000000..d3dd6d21 --- /dev/null +++ b/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h | |||
@@ -0,0 +1,765 @@ | |||
1 | #pragma once | ||
2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
3 | |||
4 | |||
5 | #ifdef __cplusplus | ||
6 | extern "C" { | ||
7 | #endif | ||
8 | |||
9 | #define ReleaseTheme(p) if (p) { ThemeFree(p); p = NULL; } | ||
10 | |||
11 | typedef HRESULT(CALLBACK *PFNTHM_EVALUATE_VARIABLE_CONDITION)( | ||
12 | __in_z LPCWSTR wzCondition, | ||
13 | __out BOOL* pf, | ||
14 | __in_opt LPVOID pvContext | ||
15 | ); | ||
16 | typedef HRESULT(CALLBACK *PFNTHM_FORMAT_VARIABLE_STRING)( | ||
17 | __in_z LPCWSTR wzFormat, | ||
18 | __inout LPWSTR* psczOut, | ||
19 | __in_opt LPVOID pvContext | ||
20 | ); | ||
21 | typedef HRESULT(CALLBACK *PFNTHM_GET_VARIABLE_NUMERIC)( | ||
22 | __in_z LPCWSTR wzVariable, | ||
23 | __out LONGLONG* pllValue, | ||
24 | __in_opt LPVOID pvContext | ||
25 | ); | ||
26 | typedef HRESULT(CALLBACK *PFNTHM_SET_VARIABLE_NUMERIC)( | ||
27 | __in_z LPCWSTR wzVariable, | ||
28 | __in LONGLONG llValue, | ||
29 | __in_opt LPVOID pvContext | ||
30 | ); | ||
31 | typedef HRESULT(CALLBACK *PFNTHM_GET_VARIABLE_STRING)( | ||
32 | __in_z LPCWSTR wzVariable, | ||
33 | __inout LPWSTR* psczValue, | ||
34 | __in_opt LPVOID pvContext | ||
35 | ); | ||
36 | typedef HRESULT(CALLBACK *PFNTHM_SET_VARIABLE_STRING)( | ||
37 | __in_z LPCWSTR wzVariable, | ||
38 | __in_z_opt LPCWSTR wzValue, | ||
39 | __in BOOL fFormatted, | ||
40 | __in_opt LPVOID pvContext | ||
41 | ); | ||
42 | |||
43 | typedef enum THEME_ACTION_TYPE | ||
44 | { | ||
45 | THEME_ACTION_TYPE_BROWSE_DIRECTORY, | ||
46 | THEME_ACTION_TYPE_CHANGE_PAGE, | ||
47 | THEME_ACTION_TYPE_CLOSE_WINDOW, | ||
48 | } THEME_ACTION_TYPE; | ||
49 | |||
50 | typedef enum THEME_CONTROL_DATA | ||
51 | { | ||
52 | THEME_CONTROL_DATA_HOVER = 1, | ||
53 | } THEME_CONTROL_DATA; | ||
54 | |||
55 | typedef enum THEME_CONTROL_TYPE | ||
56 | { | ||
57 | THEME_CONTROL_TYPE_UNKNOWN, | ||
58 | THEME_CONTROL_TYPE_BILLBOARD, | ||
59 | THEME_CONTROL_TYPE_BUTTON, | ||
60 | THEME_CONTROL_TYPE_CHECKBOX, | ||
61 | THEME_CONTROL_TYPE_COMBOBOX, | ||
62 | THEME_CONTROL_TYPE_COMMANDLINK, | ||
63 | THEME_CONTROL_TYPE_EDITBOX, | ||
64 | THEME_CONTROL_TYPE_HYPERLINK, | ||
65 | THEME_CONTROL_TYPE_HYPERTEXT, | ||
66 | THEME_CONTROL_TYPE_IMAGE, | ||
67 | THEME_CONTROL_TYPE_LABEL, | ||
68 | THEME_CONTROL_TYPE_PANEL, | ||
69 | THEME_CONTROL_TYPE_PROGRESSBAR, | ||
70 | THEME_CONTROL_TYPE_RADIOBUTTON, | ||
71 | THEME_CONTROL_TYPE_RICHEDIT, | ||
72 | THEME_CONTROL_TYPE_STATIC, | ||
73 | THEME_CONTROL_TYPE_LISTVIEW, | ||
74 | THEME_CONTROL_TYPE_TREEVIEW, | ||
75 | THEME_CONTROL_TYPE_TAB, | ||
76 | } THEME_CONTROL_TYPE; | ||
77 | |||
78 | typedef enum THEME_SHOW_PAGE_REASON | ||
79 | { | ||
80 | THEME_SHOW_PAGE_REASON_DEFAULT, | ||
81 | THEME_SHOW_PAGE_REASON_CANCEL, | ||
82 | THEME_SHOW_PAGE_REASON_REFRESH, | ||
83 | } THEME_SHOW_PAGE_REASON; | ||
84 | |||
85 | typedef enum THEME_WINDOW_INITIAL_POSITION | ||
86 | { | ||
87 | THEME_WINDOW_INITIAL_POSITION_DEFAULT, | ||
88 | THEME_WINDOW_INITIAL_POSITION_CENTER_MONITOR_FROM_COORDINATES, | ||
89 | } THEME_WINDOW_INITIAL_POSITION; | ||
90 | |||
91 | |||
92 | struct THEME_COLUMN | ||
93 | { | ||
94 | LPWSTR pszName; | ||
95 | UINT uStringId; | ||
96 | int nDefaultDpiBaseWidth; | ||
97 | int nBaseWidth; | ||
98 | int nWidth; | ||
99 | BOOL fExpands; | ||
100 | }; | ||
101 | |||
102 | |||
103 | struct THEME_TAB | ||
104 | { | ||
105 | LPWSTR pszName; | ||
106 | UINT uStringId; | ||
107 | }; | ||
108 | |||
109 | struct THEME_ACTION | ||
110 | { | ||
111 | LPWSTR sczCondition; | ||
112 | THEME_ACTION_TYPE type; | ||
113 | union | ||
114 | { | ||
115 | struct | ||
116 | { | ||
117 | LPWSTR sczVariableName; | ||
118 | } BrowseDirectory; | ||
119 | struct | ||
120 | { | ||
121 | LPWSTR sczPageName; | ||
122 | BOOL fCancel; | ||
123 | } ChangePage; | ||
124 | }; | ||
125 | }; | ||
126 | |||
127 | struct THEME_CONDITIONAL_TEXT | ||
128 | { | ||
129 | LPWSTR sczCondition; | ||
130 | LPWSTR sczText; | ||
131 | }; | ||
132 | |||
133 | // THEME_ASSIGN_CONTROL_ID - Used to apply a specific id to a named control (usually | ||
134 | // to set the WM_COMMAND). | ||
135 | struct THEME_ASSIGN_CONTROL_ID | ||
136 | { | ||
137 | WORD wId; // id to apply to control | ||
138 | LPCWSTR wzName; // name of control to match | ||
139 | }; | ||
140 | |||
141 | const DWORD THEME_FIRST_ASSIGN_CONTROL_ID = 1024; // Recommended first control id to be assigned. | ||
142 | |||
143 | struct THEME_CONTROL | ||
144 | { | ||
145 | THEME_CONTROL_TYPE type; | ||
146 | |||
147 | WORD wId; | ||
148 | WORD wPageId; | ||
149 | |||
150 | LPWSTR sczName; // optional name for control, used to apply control id and link the control to a variable. | ||
151 | LPWSTR sczText; | ||
152 | LPWSTR sczTooltip; | ||
153 | LPWSTR sczNote; // optional text for command link | ||
154 | int nDefaultDpiX; | ||
155 | int nDefaultDpiY; | ||
156 | int nDefaultDpiHeight; | ||
157 | int nDefaultDpiWidth; | ||
158 | int nX; | ||
159 | int nY; | ||
160 | int nHeight; | ||
161 | int nWidth; | ||
162 | int nSourceX; | ||
163 | int nSourceY; | ||
164 | UINT uStringId; | ||
165 | |||
166 | LPWSTR sczEnableCondition; | ||
167 | LPWSTR sczVisibleCondition; | ||
168 | BOOL fDisableVariableFunctionality; | ||
169 | |||
170 | HBITMAP hImage; | ||
171 | HICON hIcon; | ||
172 | |||
173 | // Don't free these; it's just a handle to the central image lists stored in THEME. The handle is freed once, there. | ||
174 | HIMAGELIST rghImageList[4]; | ||
175 | |||
176 | DWORD dwStyle; | ||
177 | DWORD dwExtendedStyle; | ||
178 | DWORD dwInternalStyle; | ||
179 | |||
180 | DWORD dwFontId; | ||
181 | |||
182 | // child controls | ||
183 | DWORD cControls; | ||
184 | THEME_CONTROL* rgControls; | ||
185 | |||
186 | // Used by billboard controls | ||
187 | WORD wBillboardInterval; | ||
188 | BOOL fBillboardLoops; | ||
189 | |||
190 | // Used by button and command link controls | ||
191 | THEME_ACTION* rgActions; | ||
192 | DWORD cActions; | ||
193 | THEME_ACTION* pDefaultAction; | ||
194 | |||
195 | // Used by hyperlink and owner-drawn button controls | ||
196 | DWORD dwFontHoverId; | ||
197 | DWORD dwFontSelectedId; | ||
198 | |||
199 | // Used by listview controls | ||
200 | THEME_COLUMN *ptcColumns; | ||
201 | DWORD cColumns; | ||
202 | |||
203 | // Used by radio button controls | ||
204 | BOOL fLastRadioButton; | ||
205 | LPWSTR sczValue; | ||
206 | LPWSTR sczVariable; | ||
207 | |||
208 | // Used by tab controls | ||
209 | THEME_TAB *pttTabs; | ||
210 | DWORD cTabs; | ||
211 | |||
212 | // Used by controls that have text | ||
213 | DWORD cConditionalText; | ||
214 | THEME_CONDITIONAL_TEXT* rgConditionalText; | ||
215 | |||
216 | // Used by command link controls | ||
217 | DWORD cConditionalNotes; | ||
218 | THEME_CONDITIONAL_TEXT* rgConditionalNotes; | ||
219 | |||
220 | // state variables that should be ignored | ||
221 | HWND hWnd; | ||
222 | DWORD dwData; // type specific data | ||
223 | }; | ||
224 | |||
225 | |||
226 | struct THEME_IMAGELIST | ||
227 | { | ||
228 | LPWSTR sczName; | ||
229 | |||
230 | HIMAGELIST hImageList; | ||
231 | }; | ||
232 | |||
233 | struct THEME_SAVEDVARIABLE | ||
234 | { | ||
235 | LPWSTR wzName; | ||
236 | LPWSTR sczValue; | ||
237 | }; | ||
238 | |||
239 | struct THEME_PAGE | ||
240 | { | ||
241 | WORD wId; | ||
242 | LPWSTR sczName; | ||
243 | |||
244 | DWORD cControlIndices; | ||
245 | |||
246 | DWORD cSavedVariables; | ||
247 | THEME_SAVEDVARIABLE* rgSavedVariables; | ||
248 | }; | ||
249 | |||
250 | struct THEME_FONT_INSTANCE | ||
251 | { | ||
252 | UINT nDpi; | ||
253 | HFONT hFont; | ||
254 | }; | ||
255 | |||
256 | struct THEME_FONT | ||
257 | { | ||
258 | LONG lfHeight; | ||
259 | LONG lfWeight; | ||
260 | BYTE lfUnderline; | ||
261 | BYTE lfQuality; | ||
262 | LPWSTR sczFaceName; | ||
263 | |||
264 | COLORREF crForeground; | ||
265 | HBRUSH hForeground; | ||
266 | COLORREF crBackground; | ||
267 | HBRUSH hBackground; | ||
268 | |||
269 | DWORD cFontInstances; | ||
270 | THEME_FONT_INSTANCE* rgFontInstances; | ||
271 | }; | ||
272 | |||
273 | |||
274 | struct THEME | ||
275 | { | ||
276 | WORD wId; | ||
277 | |||
278 | BOOL fAutoResize; | ||
279 | BOOL fForceResize; | ||
280 | |||
281 | DWORD dwStyle; | ||
282 | DWORD dwFontId; | ||
283 | HANDLE hIcon; | ||
284 | LPWSTR sczCaption; | ||
285 | int nDefaultDpiHeight; | ||
286 | int nDefaultDpiMinimumHeight; | ||
287 | int nDefaultDpiWidth; | ||
288 | int nDefaultDpiMinimumWidth; | ||
289 | int nHeight; | ||
290 | int nMinimumHeight; | ||
291 | int nWidth; | ||
292 | int nMinimumWidth; | ||
293 | int nWindowHeight; | ||
294 | int nWindowWidth; | ||
295 | int nSourceX; | ||
296 | int nSourceY; | ||
297 | UINT uStringId; | ||
298 | |||
299 | HBITMAP hImage; | ||
300 | |||
301 | DWORD cFonts; | ||
302 | THEME_FONT* rgFonts; | ||
303 | |||
304 | DWORD cPages; | ||
305 | THEME_PAGE* rgPages; | ||
306 | |||
307 | DWORD cImageLists; | ||
308 | THEME_IMAGELIST* rgImageLists; | ||
309 | |||
310 | DWORD cControls; | ||
311 | THEME_CONTROL* rgControls; | ||
312 | |||
313 | // internal state variables -- do not use outside ThmUtil.cpp | ||
314 | HWND hwndParent; // parent for loaded controls | ||
315 | HWND hwndHover; // current hwnd hovered over | ||
316 | DWORD dwCurrentPageId; | ||
317 | HWND hwndTooltip; | ||
318 | |||
319 | UINT nDpi; | ||
320 | |||
321 | // callback functions | ||
322 | PFNTHM_EVALUATE_VARIABLE_CONDITION pfnEvaluateCondition; | ||
323 | PFNTHM_FORMAT_VARIABLE_STRING pfnFormatString; | ||
324 | PFNTHM_GET_VARIABLE_NUMERIC pfnGetNumericVariable; | ||
325 | PFNTHM_SET_VARIABLE_NUMERIC pfnSetNumericVariable; | ||
326 | PFNTHM_GET_VARIABLE_STRING pfnGetStringVariable; | ||
327 | PFNTHM_SET_VARIABLE_STRING pfnSetStringVariable; | ||
328 | |||
329 | LPVOID pvVariableContext; | ||
330 | }; | ||
331 | |||
332 | |||
333 | /******************************************************************** | ||
334 | ThemeInitialize - initialized theme management. | ||
335 | |||
336 | *******************************************************************/ | ||
337 | HRESULT DAPI ThemeInitialize( | ||
338 | __in_opt HMODULE hModule | ||
339 | ); | ||
340 | |||
341 | /******************************************************************** | ||
342 | ThemeUninitialize - uninitialize theme management. | ||
343 | |||
344 | *******************************************************************/ | ||
345 | void DAPI ThemeUninitialize(); | ||
346 | |||
347 | /******************************************************************** | ||
348 | ThemeLoadFromFile - loads a theme from a loose file. | ||
349 | |||
350 | *******************************************************************/ | ||
351 | HRESULT DAPI ThemeLoadFromFile( | ||
352 | __in_z LPCWSTR wzThemeFile, | ||
353 | __out THEME** ppTheme | ||
354 | ); | ||
355 | |||
356 | /******************************************************************** | ||
357 | ThemeLoadFromResource - loads a theme from a module's data resource. | ||
358 | |||
359 | NOTE: The resource data must be UTF-8 encoded. | ||
360 | *******************************************************************/ | ||
361 | HRESULT DAPI ThemeLoadFromResource( | ||
362 | __in_opt HMODULE hModule, | ||
363 | __in_z LPCSTR szResource, | ||
364 | __out THEME** ppTheme | ||
365 | ); | ||
366 | |||
367 | /******************************************************************** | ||
368 | ThemeFree - frees any memory associated with a theme. | ||
369 | |||
370 | *******************************************************************/ | ||
371 | void DAPI ThemeFree( | ||
372 | __in THEME* pTheme | ||
373 | ); | ||
374 | |||
375 | /******************************************************************** | ||
376 | ThemeRegisterVariableCallbacks - registers a context and callbacks | ||
377 | for working with variables. | ||
378 | |||
379 | *******************************************************************/ | ||
380 | HRESULT DAPI ThemeRegisterVariableCallbacks( | ||
381 | __in THEME* pTheme, | ||
382 | __in_opt PFNTHM_EVALUATE_VARIABLE_CONDITION pfnEvaluateCondition, | ||
383 | __in_opt PFNTHM_FORMAT_VARIABLE_STRING pfnFormatString, | ||
384 | __in_opt PFNTHM_GET_VARIABLE_NUMERIC pfnGetNumericVariable, | ||
385 | __in_opt PFNTHM_SET_VARIABLE_NUMERIC pfnSetNumericVariable, | ||
386 | __in_opt PFNTHM_GET_VARIABLE_STRING pfnGetStringVariable, | ||
387 | __in_opt PFNTHM_SET_VARIABLE_STRING pfnSetStringVariable, | ||
388 | __in_opt LPVOID pvContext | ||
389 | ); | ||
390 | |||
391 | /******************************************************************** | ||
392 | ThemeCreateParentWindow - creates a parent window for the theme. | ||
393 | |||
394 | *******************************************************************/ | ||
395 | HRESULT DAPI ThemeCreateParentWindow( | ||
396 | __in THEME* pTheme, | ||
397 | __in DWORD dwExStyle, | ||
398 | __in LPCWSTR szClassName, | ||
399 | __in LPCWSTR szWindowName, | ||
400 | __in DWORD dwStyle, | ||
401 | __in int x, | ||
402 | __in int y, | ||
403 | __in_opt HWND hwndParent, | ||
404 | __in_opt HINSTANCE hInstance, | ||
405 | __in_opt LPVOID lpParam, | ||
406 | __in THEME_WINDOW_INITIAL_POSITION initialPosition, | ||
407 | __out_opt HWND* phWnd | ||
408 | ); | ||
409 | |||
410 | /******************************************************************** | ||
411 | ThemeLoadControls - creates the windows for all the theme controls | ||
412 | using the window created in ThemeCreateParentWindow. | ||
413 | |||
414 | *******************************************************************/ | ||
415 | HRESULT DAPI ThemeLoadControls( | ||
416 | __in THEME* pTheme, | ||
417 | __in_ecount_opt(cAssignControlIds) const THEME_ASSIGN_CONTROL_ID* rgAssignControlIds, | ||
418 | __in DWORD cAssignControlIds | ||
419 | ); | ||
420 | |||
421 | /******************************************************************** | ||
422 | ThemeUnloadControls - resets all the theme control windows so the theme | ||
423 | controls can be reloaded. | ||
424 | |||
425 | *******************************************************************/ | ||
426 | void DAPI ThemeUnloadControls( | ||
427 | __in THEME* pTheme | ||
428 | ); | ||
429 | |||
430 | /******************************************************************** | ||
431 | ThemeLocalize - Localizes all of the strings in the theme. | ||
432 | |||
433 | *******************************************************************/ | ||
434 | HRESULT DAPI ThemeLocalize( | ||
435 | __in THEME *pTheme, | ||
436 | __in const WIX_LOCALIZATION *pLocStringSet | ||
437 | ); | ||
438 | |||
439 | HRESULT DAPI ThemeLoadStrings( | ||
440 | __in THEME* pTheme, | ||
441 | __in HMODULE hResModule | ||
442 | ); | ||
443 | |||
444 | /******************************************************************** | ||
445 | ThemeLoadRichEditFromFile - Attach a richedit control to a RTF file. | ||
446 | |||
447 | *******************************************************************/ | ||
448 | HRESULT DAPI ThemeLoadRichEditFromFile( | ||
449 | __in THEME* pTheme, | ||
450 | __in DWORD dwControl, | ||
451 | __in_z LPCWSTR wzFileName, | ||
452 | __in HMODULE hModule | ||
453 | ); | ||
454 | |||
455 | /******************************************************************** | ||
456 | ThemeLoadRichEditFromResource - Attach a richedit control to resource data. | ||
457 | |||
458 | *******************************************************************/ | ||
459 | HRESULT DAPI ThemeLoadRichEditFromResource( | ||
460 | __in THEME* pTheme, | ||
461 | __in DWORD dwControl, | ||
462 | __in_z LPCSTR szResourceName, | ||
463 | __in HMODULE hModule | ||
464 | ); | ||
465 | |||
466 | /******************************************************************** | ||
467 | ThemeLoadRichEditFromResourceToHWnd - Attach a richedit control (by | ||
468 | HWND) to resource data. | ||
469 | |||
470 | *******************************************************************/ | ||
471 | HRESULT DAPI ThemeLoadRichEditFromResourceToHWnd( | ||
472 | __in HWND hWnd, | ||
473 | __in_z LPCSTR szResourceName, | ||
474 | __in HMODULE hModule | ||
475 | ); | ||
476 | |||
477 | /******************************************************************** | ||
478 | ThemeHandleKeyboardMessage - will translate the message using the active | ||
479 | accelerator table. | ||
480 | |||
481 | *******************************************************************/ | ||
482 | BOOL DAPI ThemeHandleKeyboardMessage( | ||
483 | __in_opt THEME* pTheme, | ||
484 | __in HWND hWnd, | ||
485 | __in MSG* pMsg | ||
486 | ); | ||
487 | |||
488 | /******************************************************************** | ||
489 | ThemeDefWindowProc - replacement for DefWindowProc() when using theme. | ||
490 | |||
491 | *******************************************************************/ | ||
492 | LRESULT CALLBACK ThemeDefWindowProc( | ||
493 | __in_opt THEME* pTheme, | ||
494 | __in HWND hWnd, | ||
495 | __in UINT uMsg, | ||
496 | __in WPARAM wParam, | ||
497 | __in LPARAM lParam | ||
498 | ); | ||
499 | |||
500 | /******************************************************************** | ||
501 | ThemeGetPageIds - gets the page ids for the theme via page names. | ||
502 | |||
503 | *******************************************************************/ | ||
504 | void DAPI ThemeGetPageIds( | ||
505 | __in const THEME* pTheme, | ||
506 | __in_ecount(cGetPages) LPCWSTR* rgwzFindNames, | ||
507 | __inout_ecount(cGetPages) DWORD* rgdwPageIds, | ||
508 | __in DWORD cGetPages | ||
509 | ); | ||
510 | |||
511 | /******************************************************************** | ||
512 | ThemeGetPage - gets a theme page by id. | ||
513 | |||
514 | *******************************************************************/ | ||
515 | THEME_PAGE* DAPI ThemeGetPage( | ||
516 | __in const THEME* pTheme, | ||
517 | __in DWORD dwPage | ||
518 | ); | ||
519 | |||
520 | /******************************************************************** | ||
521 | ThemeShowPage - shows or hides all of the controls in the page at one time. | ||
522 | |||
523 | *******************************************************************/ | ||
524 | HRESULT DAPI ThemeShowPage( | ||
525 | __in THEME* pTheme, | ||
526 | __in DWORD dwPage, | ||
527 | __in int nCmdShow | ||
528 | ); | ||
529 | |||
530 | /******************************************************************** | ||
531 | ThemeShowPageEx - shows or hides all of the controls in the page at one time. | ||
532 | When using variables, TSPR_CANCEL reverts any changes made. | ||
533 | TSPR_REFRESH forces reevaluation of conditions. | ||
534 | It is expected that the current page is hidden before | ||
535 | showing a new page. | ||
536 | |||
537 | *******************************************************************/ | ||
538 | HRESULT DAPI ThemeShowPageEx( | ||
539 | __in THEME* pTheme, | ||
540 | __in DWORD dwPage, | ||
541 | __in int nCmdShow, | ||
542 | __in THEME_SHOW_PAGE_REASON reason | ||
543 | ); | ||
544 | |||
545 | |||
546 | /******************************************************************** | ||
547 | ThemeShowChild - shows a control's specified child control, hiding the rest. | ||
548 | |||
549 | *******************************************************************/ | ||
550 | void DAPI ThemeShowChild( | ||
551 | __in THEME* pTheme, | ||
552 | __in THEME_CONTROL* pParentControl, | ||
553 | __in DWORD dwIndex | ||
554 | ); | ||
555 | |||
556 | /******************************************************************** | ||
557 | ThemeControlExists - check if a control with the specified id exists. | ||
558 | |||
559 | *******************************************************************/ | ||
560 | BOOL DAPI ThemeControlExists( | ||
561 | __in const THEME* pTheme, | ||
562 | __in DWORD dwControl | ||
563 | ); | ||
564 | |||
565 | /******************************************************************** | ||
566 | ThemeControlEnable - enables/disables a control. | ||
567 | |||
568 | *******************************************************************/ | ||
569 | void DAPI ThemeControlEnable( | ||
570 | __in THEME* pTheme, | ||
571 | __in DWORD dwControl, | ||
572 | __in BOOL fEnable | ||
573 | ); | ||
574 | |||
575 | /******************************************************************** | ||
576 | ThemeControlEnabled - returns whether a control is enabled/disabled. | ||
577 | |||
578 | *******************************************************************/ | ||
579 | BOOL DAPI ThemeControlEnabled( | ||
580 | __in THEME* pTheme, | ||
581 | __in DWORD dwControl | ||
582 | ); | ||
583 | |||
584 | /******************************************************************** | ||
585 | ThemeControlElevates - sets/removes the shield icon on a control. | ||
586 | |||
587 | *******************************************************************/ | ||
588 | void DAPI ThemeControlElevates( | ||
589 | __in THEME* pTheme, | ||
590 | __in DWORD dwControl, | ||
591 | __in BOOL fElevates | ||
592 | ); | ||
593 | |||
594 | /******************************************************************** | ||
595 | ThemeShowControl - shows/hides a control. | ||
596 | |||
597 | *******************************************************************/ | ||
598 | void DAPI ThemeShowControl( | ||
599 | __in THEME* pTheme, | ||
600 | __in DWORD dwControl, | ||
601 | __in int nCmdShow | ||
602 | ); | ||
603 | |||
604 | /******************************************************************** | ||
605 | ThemeShowControlEx - shows/hides a control with support for | ||
606 | conditional text and notes. | ||
607 | |||
608 | *******************************************************************/ | ||
609 | void DAPI ThemeShowControlEx( | ||
610 | __in THEME* pTheme, | ||
611 | __in DWORD dwControl, | ||
612 | __in int nCmdShow | ||
613 | ); | ||
614 | |||
615 | /******************************************************************** | ||
616 | ThemeControlVisible - returns whether a control is visible. | ||
617 | |||
618 | *******************************************************************/ | ||
619 | BOOL DAPI ThemeControlVisible( | ||
620 | __in THEME* pTheme, | ||
621 | __in DWORD dwControl | ||
622 | ); | ||
623 | |||
624 | BOOL DAPI ThemePostControlMessage( | ||
625 | __in THEME* pTheme, | ||
626 | __in DWORD dwControl, | ||
627 | __in UINT Msg, | ||
628 | __in WPARAM wParam, | ||
629 | __in LPARAM lParam | ||
630 | ); | ||
631 | |||
632 | LRESULT DAPI ThemeSendControlMessage( | ||
633 | __in const THEME* pTheme, | ||
634 | __in DWORD dwControl, | ||
635 | __in UINT Msg, | ||
636 | __in WPARAM wParam, | ||
637 | __in LPARAM lParam | ||
638 | ); | ||
639 | |||
640 | /******************************************************************** | ||
641 | ThemeDrawBackground - draws the theme background. | ||
642 | |||
643 | *******************************************************************/ | ||
644 | HRESULT DAPI ThemeDrawBackground( | ||
645 | __in THEME* pTheme, | ||
646 | __in PAINTSTRUCT* pps | ||
647 | ); | ||
648 | |||
649 | /******************************************************************** | ||
650 | ThemeDrawControl - draw an owner drawn control. | ||
651 | |||
652 | *******************************************************************/ | ||
653 | HRESULT DAPI ThemeDrawControl( | ||
654 | __in THEME* pTheme, | ||
655 | __in DRAWITEMSTRUCT* pdis | ||
656 | ); | ||
657 | |||
658 | /******************************************************************** | ||
659 | ThemeHoverControl - mark a control as hover. | ||
660 | |||
661 | *******************************************************************/ | ||
662 | BOOL DAPI ThemeHoverControl( | ||
663 | __in THEME* pTheme, | ||
664 | __in HWND hwndParent, | ||
665 | __in HWND hwndControl | ||
666 | ); | ||
667 | |||
668 | /******************************************************************** | ||
669 | ThemeIsControlChecked - gets whether a control is checked. Only | ||
670 | really useful for checkbox controls. | ||
671 | |||
672 | *******************************************************************/ | ||
673 | BOOL DAPI ThemeIsControlChecked( | ||
674 | __in THEME* pTheme, | ||
675 | __in DWORD dwControl | ||
676 | ); | ||
677 | |||
678 | /******************************************************************** | ||
679 | ThemeSetControlColor - sets the color of text for a control. | ||
680 | |||
681 | *******************************************************************/ | ||
682 | BOOL DAPI ThemeSetControlColor( | ||
683 | __in THEME* pTheme, | ||
684 | __in HDC hdc, | ||
685 | __in HWND hWnd, | ||
686 | __out HBRUSH* phBackgroundBrush | ||
687 | ); | ||
688 | |||
689 | /******************************************************************** | ||
690 | ThemeSetProgressControl - sets the current percentage complete in a | ||
691 | progress bar control. | ||
692 | |||
693 | *******************************************************************/ | ||
694 | HRESULT DAPI ThemeSetProgressControl( | ||
695 | __in THEME* pTheme, | ||
696 | __in DWORD dwControl, | ||
697 | __in DWORD dwProgressPercentage | ||
698 | ); | ||
699 | |||
700 | /******************************************************************** | ||
701 | ThemeSetProgressControlColor - sets the current color of a | ||
702 | progress bar control. | ||
703 | |||
704 | *******************************************************************/ | ||
705 | HRESULT DAPI ThemeSetProgressControlColor( | ||
706 | __in THEME* pTheme, | ||
707 | __in DWORD dwControl, | ||
708 | __in DWORD dwColorIndex | ||
709 | ); | ||
710 | |||
711 | /******************************************************************** | ||
712 | ThemeSetTextControl - sets the text of a control. | ||
713 | |||
714 | *******************************************************************/ | ||
715 | HRESULT DAPI ThemeSetTextControl( | ||
716 | __in const THEME* pTheme, | ||
717 | __in DWORD dwControl, | ||
718 | __in_z_opt LPCWSTR wzText | ||
719 | ); | ||
720 | |||
721 | /******************************************************************** | ||
722 | ThemeSetTextControl - sets the text of a control and optionally | ||
723 | invalidates the control. | ||
724 | |||
725 | *******************************************************************/ | ||
726 | HRESULT DAPI ThemeSetTextControlEx( | ||
727 | __in const THEME* pTheme, | ||
728 | __in DWORD dwControl, | ||
729 | __in BOOL fUpdate, | ||
730 | __in_z_opt LPCWSTR wzText | ||
731 | ); | ||
732 | |||
733 | /******************************************************************** | ||
734 | ThemeGetTextControl - gets the text of a control. | ||
735 | |||
736 | *******************************************************************/ | ||
737 | HRESULT DAPI ThemeGetTextControl( | ||
738 | __in const THEME* pTheme, | ||
739 | __in DWORD dwControl, | ||
740 | __inout_z LPWSTR* psczText | ||
741 | ); | ||
742 | |||
743 | /******************************************************************** | ||
744 | ThemeUpdateCaption - updates the caption in the theme. | ||
745 | |||
746 | *******************************************************************/ | ||
747 | HRESULT DAPI ThemeUpdateCaption( | ||
748 | __in THEME* pTheme, | ||
749 | __in_z LPCWSTR wzCaption | ||
750 | ); | ||
751 | |||
752 | /******************************************************************** | ||
753 | ThemeSetFocus - set the focus to the control supplied or the next | ||
754 | enabled control if it is disabled. | ||
755 | |||
756 | *******************************************************************/ | ||
757 | void DAPI ThemeSetFocus( | ||
758 | __in THEME* pTheme, | ||
759 | __in DWORD dwControl | ||
760 | ); | ||
761 | |||
762 | #ifdef __cplusplus | ||
763 | } | ||
764 | #endif | ||
765 | |||