ReactOS 0.4.16-dev-1369-gd4d04c8
system.c
Go to the documentation of this file.
1/*
2 * Win32 5.1 Theme system
3 *
4 * Copyright (C) 2003 Kevin Koltzau
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include "uxthemep.h"
22
23#include <stdio.h>
24#include <winreg.h>
25#include <uxundoc.h>
26
28
29/***********************************************************************
30 * Defines and global variables
31 */
32
33static const WCHAR szThemeManager[] = {
34 'S','o','f','t','w','a','r','e','\\',
35 'M','i','c','r','o','s','o','f','t','\\',
36 'W','i','n','d','o','w','s','\\',
37 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
38 'T','h','e','m','e','M','a','n','a','g','e','r','\0'
39};
40static const WCHAR szThemeActive[] = {'T','h','e','m','e','A','c','t','i','v','e','\0'};
41static const WCHAR szSizeName[] = {'S','i','z','e','N','a','m','e','\0'};
42static const WCHAR szColorName[] = {'C','o','l','o','r','N','a','m','e','\0'};
43static const WCHAR szDllName[] = {'D','l','l','N','a','m','e','\0'};
44
45static const WCHAR szIniDocumentation[] = {'d','o','c','u','m','e','n','t','a','t','i','o','n','\0'};
46
49
50static DWORD dwThemeAppProperties = STAP_ALLOW_NONCLIENT | STAP_ALLOW_CONTROLS;
55
57
60
61/***********************************************************************/
62
64{
65 SendMessageW(hWnd, WM_THEMECHANGED, enable, 0);
66 return TRUE;
67}
68
69/* Broadcast WM_THEMECHANGED to *all* windows, including children */
71{
72 if (hWnd == NULL)
73 {
75 }
76 else
77 {
80 }
81 return TRUE;
82}
83
84/* At the end of the day this is a subset of what SHRegGetPath() does - copied
85 * here to avoid linking against shlwapi. */
88{
89 DWORD dwRet, dwType, dwUnExpDataLen = MAX_PATH * sizeof(WCHAR), dwExpDataLen;
90
91 TRACE("(hkey=%p,%s,%p)\n", hKey, debugstr_w(lpszValue),
92 pvData);
93
94 dwRet = RegQueryValueExW(hKey, lpszValue, 0, &dwType, pvData, &dwUnExpDataLen);
95 if (dwRet!=ERROR_SUCCESS && dwRet!=ERROR_MORE_DATA)
96 return dwRet;
97
98 if (dwType == REG_EXPAND_SZ)
99 {
100 DWORD nBytesToAlloc;
101
102 /* Expand type REG_EXPAND_SZ into REG_SZ */
103 LPWSTR szData;
104
105 /* If the caller didn't supply a buffer or the buffer is too small we have
106 * to allocate our own
107 */
108 if (dwRet == ERROR_MORE_DATA)
109 {
110 WCHAR cNull = '\0';
111 nBytesToAlloc = dwUnExpDataLen;
112
113 szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc);
114 RegQueryValueExW (hKey, lpszValue, 0, NULL, (LPBYTE)szData, &nBytesToAlloc);
115 dwExpDataLen = ExpandEnvironmentStringsW(szData, &cNull, 1);
116 dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen);
117 LocalFree(szData);
118 }
119 else
120 {
121 nBytesToAlloc = (lstrlenW(pvData) + 1) * sizeof(WCHAR);
122 szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc );
123 lstrcpyW(szData, pvData);
124 dwExpDataLen = ExpandEnvironmentStringsW(szData, pvData, MAX_PATH );
125 if (dwExpDataLen > MAX_PATH) dwRet = ERROR_MORE_DATA;
126 dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen);
127 LocalFree(szData);
128 }
129 }
130
131 return dwRet;
132}
133
135{
140 {
143 }
144 return S_OK;
145}
146
147static BOOL bIsThemeActive(LPCWSTR pszTheme, LPCWSTR pszColor, LPCWSTR pszSize)
148{
149 if (g_ActiveThemeFile == NULL)
150 return FALSE;
151
152 if (wcscmp(pszTheme, g_ActiveThemeFile->szThemeFile) != 0)
153 return FALSE;
154
155 if (!pszColor[0])
156 {
158 return FALSE;
159 }
160 else
161 {
162 if (wcscmp(pszColor, g_ActiveThemeFile->pszSelectedColor) != 0)
163 return FALSE;
164 }
165
166 if (!pszSize[0])
167 {
169 return FALSE;
170 }
171 else
172 {
173 if (wcscmp(pszSize, g_ActiveThemeFile->pszSelectedSize) != 0)
174 return FALSE;
175 }
176
177 return TRUE;
178}
179
180/***********************************************************************
181 * UXTHEME_LoadTheme
182 *
183 * Set the current active theme from the registry
184 */
186{
187 HKEY hKey;
188 DWORD buffsize;
189 HRESULT hr;
190 WCHAR tmp[10];
192 WCHAR szCurrentTheme[MAX_PATH];
193 WCHAR szCurrentColor[64];
194 WCHAR szCurrentSize[64];
196
197 if ((bLoad != FALSE) && g_bThemeHooksActive)
198 {
199 /* Get current theme configuration */
201 TRACE("Loading theme config\n");
202 buffsize = sizeof(tmp);
203 if(!RegQueryValueExW(hKey, szThemeActive, NULL, NULL, (LPBYTE)tmp, &buffsize)) {
204 bThemeActive = (tmp[0] != '0');
205 }
206 else {
208 TRACE("Failed to get ThemeActive: %d\n", GetLastError());
209 }
210 buffsize = sizeof(szCurrentColor);
211 if(RegQueryValueExW(hKey, szColorName, NULL, NULL, (LPBYTE)szCurrentColor, &buffsize))
212 szCurrentColor[0] = '\0';
213 buffsize = sizeof(szCurrentSize);
214 if(RegQueryValueExW(hKey, szSizeName, NULL, NULL, (LPBYTE)szCurrentSize, &buffsize))
215 szCurrentSize[0] = '\0';
216 if (query_reg_path (hKey, szDllName, szCurrentTheme))
217 szCurrentTheme[0] = '\0';
219 }
220 else
221 TRACE("Failed to open theme registry key\n");
222 }
223 else
224 {
226 }
227
228 if(bThemeActive)
229 {
230 if( bIsThemeActive(szCurrentTheme, szCurrentColor, szCurrentSize) )
231 {
232 TRACE("Tried to load active theme again\n");
233 return;
234 }
235
236 /* Make sure the theme requested is actually valid */
237 hr = MSSTYLES_OpenThemeFile(szCurrentTheme,
238 szCurrentColor[0]?szCurrentColor:NULL,
239 szCurrentSize[0]?szCurrentSize:NULL,
240 &pt);
241 if(FAILED(hr)) {
243 }
244 else {
245 TRACE("Theme active: %s %s %s\n", debugstr_w(szCurrentTheme),
246 debugstr_w(szCurrentColor), debugstr_w(szCurrentSize));
247
250 }
251 }
252 if(!bThemeActive) {
254 TRACE("Theming not active\n");
255 }
256}
257
258/***********************************************************************/
259
260static const char * const SysColorsNames[] =
261{
262 "Scrollbar", /* COLOR_SCROLLBAR */
263 "Background", /* COLOR_BACKGROUND */
264 "ActiveTitle", /* COLOR_ACTIVECAPTION */
265 "InactiveTitle", /* COLOR_INACTIVECAPTION */
266 "Menu", /* COLOR_MENU */
267 "Window", /* COLOR_WINDOW */
268 "WindowFrame", /* COLOR_WINDOWFRAME */
269 "MenuText", /* COLOR_MENUTEXT */
270 "WindowText", /* COLOR_WINDOWTEXT */
271 "TitleText", /* COLOR_CAPTIONTEXT */
272 "ActiveBorder", /* COLOR_ACTIVEBORDER */
273 "InactiveBorder", /* COLOR_INACTIVEBORDER */
274 "AppWorkSpace", /* COLOR_APPWORKSPACE */
275 "Hilight", /* COLOR_HIGHLIGHT */
276 "HilightText", /* COLOR_HIGHLIGHTTEXT */
277 "ButtonFace", /* COLOR_BTNFACE */
278 "ButtonShadow", /* COLOR_BTNSHADOW */
279 "GrayText", /* COLOR_GRAYTEXT */
280 "ButtonText", /* COLOR_BTNTEXT */
281 "InactiveTitleText", /* COLOR_INACTIVECAPTIONTEXT */
282 "ButtonHilight", /* COLOR_BTNHIGHLIGHT */
283 "ButtonDkShadow", /* COLOR_3DDKSHADOW */
284 "ButtonLight", /* COLOR_3DLIGHT */
285 "InfoText", /* COLOR_INFOTEXT */
286 "InfoWindow", /* COLOR_INFOBK */
287 "ButtonAlternateFace", /* COLOR_ALTERNATEBTNFACE */
288 "HotTrackingColor", /* COLOR_HOTLIGHT */
289 "GradientActiveTitle", /* COLOR_GRADIENTACTIVECAPTION */
290 "GradientInactiveTitle", /* COLOR_GRADIENTINACTIVECAPTION */
291 "MenuHilight", /* COLOR_MENUHILIGHT */
292 "MenuBar", /* COLOR_MENUBAR */
293};
294static const WCHAR strColorKey[] =
295 { 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
296 'C','o','l','o','r','s',0 };
297static const WCHAR keyFlatMenus[] = { 'F','l','a','t','M','e','n','u', 0};
298static const WCHAR keyGradientCaption[] = { 'G','r','a','d','i','e','n','t',
299 'C','a','p','t','i','o','n', 0 };
300static const WCHAR keyNonClientMetrics[] = { 'N','o','n','C','l','i','e','n','t',
301 'M','e','t','r','i','c','s',0 };
302static const WCHAR keyIconTitleFont[] = { 'I','c','o','n','T','i','t','l','e',
303 'F','o','n','t',0 };
304
305static const struct BackupSysParam
306{
309} backupSysParams[] =
310{
311 {SPI_GETFLATMENU, SPI_SETFLATMENU, keyFlatMenus},
312 {SPI_GETGRADIENTCAPTIONS, SPI_SETGRADIENTCAPTIONS, keyGradientCaption},
313 {-1, -1, 0}
315
316#define NUM_SYS_COLORS (COLOR_MENUBAR+1)
317
318static void save_sys_colors (HKEY baseKey)
319{
320 char colorStr[13];
321 HKEY hKey;
322 int i;
323
324 if (RegCreateKeyExW( baseKey, strColorKey,
325 0, 0, 0, KEY_ALL_ACCESS,
326 0, &hKey, 0 ) == ERROR_SUCCESS)
327 {
328 for (i = 0; i < NUM_SYS_COLORS; i++)
329 {
330 COLORREF col = GetSysColor (i);
331
332 sprintf (colorStr, "%d %d %d",
333 GetRValue (col), GetGValue (col), GetBValue (col));
334
336 (BYTE*)colorStr, strlen (colorStr)+1);
337 }
339 }
340}
341
342/* Before activating a theme, query current system colors, certain settings
343 * and backup them in the registry, so they can be restored when the theme
344 * is deactivated */
346{
347 HKEY hKey;
348 const struct BackupSysParam* bsp = backupSysParams;
349
351 0, 0, 0, KEY_ALL_ACCESS,
352 0, &hKey, 0) == ERROR_SUCCESS)
353 {
354 NONCLIENTMETRICSW ncm;
355 LOGFONTW iconTitleFont;
356
357 /* back up colors */
359
360 /* back up "other" settings */
361 while (bsp->spiGet >= 0)
362 {
363 DWORD value;
364
365 SystemParametersInfoW (bsp->spiGet, 0, &value, 0);
367 (LPBYTE)&value, sizeof (value));
368
369 bsp++;
370 }
371
372 /* back up non-client metrics */
373 memset (&ncm, 0, sizeof (ncm));
374 ncm.cbSize = sizeof (ncm);
375 SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, sizeof (ncm), &ncm, 0);
377 sizeof (ncm));
378 memset (&iconTitleFont, 0, sizeof (iconTitleFont));
379 SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof (iconTitleFont),
380 &iconTitleFont, 0);
382 (LPBYTE)&iconTitleFont, sizeof (iconTitleFont));
383
385 }
386}
387
388/* Read back old settings after a theme was deactivated */
390{
391 HKEY hKey;
392 const struct BackupSysParam* bsp = backupSysParams;
393
396 {
397 HKEY colorKey;
398
399 /* read backed-up colors */
401 0, KEY_QUERY_VALUE, &colorKey) == ERROR_SUCCESS)
402 {
403 int i;
404 COLORREF sysCols[NUM_SYS_COLORS];
405 int sysColsIndices[NUM_SYS_COLORS];
406 int sysColCount = 0;
407
408 for (i = 0; i < NUM_SYS_COLORS; i++)
409 {
410 DWORD type;
411 char colorStr[13];
412 DWORD count = sizeof(colorStr);
413
414 if (RegQueryValueExA (colorKey, SysColorsNames[i], 0,
415 &type, (LPBYTE) colorStr, &count) == ERROR_SUCCESS)
416 {
417 int r, g, b;
418 if (sscanf (colorStr, "%d %d %d", &r, &g, &b) == 3)
419 {
420 sysColsIndices[sysColCount] = i;
421 sysCols[sysColCount] = RGB(r, g, b);
422 sysColCount++;
423 }
424 }
425 }
426 RegCloseKey (colorKey);
427
428 SetSysColors (sysColCount, sysColsIndices, sysCols);
429 }
430
431 /* read backed-up other settings */
432 while (bsp->spiGet >= 0)
433 {
434 DWORD value;
435 DWORD count = sizeof(value);
436 DWORD type;
437
438 if (RegQueryValueExW (hKey, bsp->keyName, 0,
440 {
442 }
443
444 bsp++;
445 }
446
447 /* read backed-up non-client metrics */
448 {
449 NONCLIENTMETRICSW ncm;
450 LOGFONTW iconTitleFont;
451 DWORD count = sizeof(ncm);
452 DWORD type;
453
455 &type, (LPBYTE)&ncm, &count) == ERROR_SUCCESS)
456 {
457 SystemParametersInfoW (SPI_SETNONCLIENTMETRICS,
459 }
460
461 count = sizeof(iconTitleFont);
462
464 &type, (LPBYTE)&iconTitleFont, &count) == ERROR_SUCCESS)
465 {
467 count, &iconTitleFont, SPIF_UPDATEINIFILE);
468 }
469 }
470
472 }
473}
474
475/* Make system settings persistent, so they're in effect even w/o uxtheme
476 * loaded.
477 * For efficiency reasons, only the last SystemParametersInfoW sets
478 * SPIF_SENDCHANGE */
480{
481 const struct BackupSysParam* bsp = backupSysParams;
482 NONCLIENTMETRICSW ncm;
483 LOGFONTW iconTitleFont;
484
486
487 while (bsp->spiGet >= 0)
488 {
489 DWORD value;
490
491 SystemParametersInfoW (bsp->spiGet, 0, &value, 0);
493 bsp++;
494 }
495
496 memset (&ncm, 0, sizeof (ncm));
497 ncm.cbSize = sizeof (ncm);
498 SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, sizeof (ncm), &ncm, 0);
499 SystemParametersInfoW (SPI_SETNONCLIENTMETRICS, sizeof (ncm), &ncm,
501
502 memset (&iconTitleFont, 0, sizeof (iconTitleFont));
503 SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof (iconTitleFont),
504 &iconTitleFont, 0);
505 SystemParametersInfoW (SPI_SETICONTITLELOGFONT, sizeof (iconTitleFont),
506 &iconTitleFont, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
507}
508
509/***********************************************************************
510 * UXTHEME_ApplyTheme
511 *
512 * Change the current active theme
513 */
515{
516 HKEY hKey;
517 WCHAR tmp[2];
518 HRESULT hr;
519
520 TRACE("UXTHEME_ApplyTheme\n");
521
522 if (tf && !g_ActiveThemeFile)
523 {
525 }
526
528 if (FAILED(hr))
529 return hr;
530
531 if (!tf)
532 {
534 }
535
536 TRACE("Writing theme config to registry\n");
538 tmp[0] = g_ActiveThemeFile ? '1' : '0';
539 tmp[1] = '\0';
540 RegSetValueExW(hKey, szThemeActive, 0, REG_SZ, (const BYTE*)tmp, sizeof(WCHAR)*2);
541 if (g_ActiveThemeFile) {
542 RegSetValueExW(hKey, szColorName, 0, REG_SZ, (const BYTE*)tf->pszSelectedColor,
543 (lstrlenW(tf->pszSelectedColor)+1)*sizeof(WCHAR));
544 RegSetValueExW(hKey, szSizeName, 0, REG_SZ, (const BYTE*)tf->pszSelectedSize,
545 (lstrlenW(tf->pszSelectedSize)+1)*sizeof(WCHAR));
546 RegSetValueExW(hKey, szDllName, 0, REG_SZ, (const BYTE*)tf->szThemeFile,
547 (lstrlenW(tf->szThemeFile)+1)*sizeof(WCHAR));
548#ifdef __REACTOS__
549 {
550 WCHAR buf[sizeof("4294967295")];
552 RegSetValueExW(hKey, L"LastUserLangID", 0, REG_SZ, (const BYTE*)buf, ++cch * sizeof(WCHAR));
553 }
554#endif
555 }
556 else {
560#ifdef __REACTOS__
561 RegDeleteValueW(hKey, L"LastUserLangID");
562#endif
563 }
565 }
566 else
567 TRACE("Failed to open theme registry key\n");
568
570
571 return hr;
572}
573
574/***********************************************************************
575 * UXTHEME_InitSystem
576 */
578{
579 static const WCHAR szWindowTheme[] = {
580 'u','x','_','t','h','e','m','e','\0'
581 };
582 static const WCHAR szSubAppName[] = {
583 'u','x','_','s','u','b','a','p','p','\0'
584 };
585 static const WCHAR szSubIdList[] = {
586 'u','x','_','s','u','b','i','d','l','s','t','\0'
587 };
588 static const WCHAR szDialogThemeEnabled[] = {
589 'u','x','_','d','i','a','l','o','g','t','h','e','m','e','\0'
590 };
591
592 hDllInst = hInst;
593
594 atWindowTheme = GlobalAddAtomW(szWindowTheme);
595 atSubAppName = GlobalAddAtomW(szSubAppName);
596 atSubIdList = GlobalAddAtomW(szSubIdList);
597 atDialogThemeEnabled = GlobalAddAtomW(szDialogThemeEnabled);
598 atWndContext = GlobalAddAtomW(L"ux_WndContext");
599
601 g_cHandles = 0;
602
604}
605
606/***********************************************************************
607 * UXTHEME_UnInitSystem
608 */
610{
612
615}
616
617/***********************************************************************
618 * IsAppThemed (UXTHEME.@)
619 */
621{
622 TRACE("\n");
624 return (g_ActiveThemeFile != NULL);
625}
626
627/***********************************************************************
628 * IsThemeActive (UXTHEME.@)
629 */
631{
632 BOOL bActive;
634 HKEY hKey;
635 WCHAR tmp[10];
636 DWORD buffsize;
637
638 TRACE("IsThemeActive\n");
640
642 return TRUE;
643
645 return FALSE;
646
647 bActive = FALSE;
649 if (Result == ERROR_SUCCESS)
650 {
651 buffsize = sizeof(tmp);
652 if (!RegQueryValueExW(hKey, szThemeActive, NULL, NULL, (LPBYTE)tmp, &buffsize))
653 bActive = (tmp[0] != '0');
655 }
656
657 return bActive;
658}
659
661
662/************************************************************
663* IsCompositionActive (UXTHEME.@)
664*/
666{
667 BOOL bIsCompositionActive;
668 DWMISCOMPOSITIONENABLED pDwmIsCompositionEnabled;
669 HMODULE hdwmapi = GetModuleHandleW(L"dwmapi.dll");
670
671 if (!hdwmapi)
672 {
673 hdwmapi = LoadLibraryW(L"dwmapi.dll");
674 if (!hdwmapi)
675 {
676 ERR("Failed to load dwmapi\n");
677 return FALSE;
678 }
679
680 pDwmIsCompositionEnabled = (DWMISCOMPOSITIONENABLED)GetProcAddress(hdwmapi, "DwmIsCompositionEnabled");
681 }
682 if (!pDwmIsCompositionEnabled)
683 return FALSE;
684
685 if (pDwmIsCompositionEnabled(&bIsCompositionActive) == S_OK)
686 return bIsCompositionActive;
687
688 return FALSE;
689}
690
691/***********************************************************************
692 * EnableTheming (UXTHEME.@)
693 *
694 * NOTES
695 * This is a global and persistent change
696 */
698{
699 HKEY hKey;
700 WCHAR szEnabled[] = {'0','\0'};
701
702 TRACE("(%d)\n", fEnable);
703
704 if (fEnable != (g_ActiveThemeFile != NULL)) {
705 if(fEnable)
707 else
710
711 if (fEnable) szEnabled[0] = '1';
713 RegSetValueExW(hKey, szThemeActive, 0, REG_SZ, (LPBYTE)szEnabled, sizeof(WCHAR));
715 }
717 }
718 return S_OK;
719}
720
721/***********************************************************************
722 * UXTHEME_SetWindowProperty
723 *
724 * I'm using atoms as there may be large numbers of duplicated strings
725 * and they do the work of keeping memory down as a cause of that quite nicely
726 */
728{
729 ATOM oldValue = (ATOM)(size_t)RemovePropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp));
730 if(oldValue)
731 {
732 DeleteAtom(oldValue);
733 }
734
735 if(pszValue)
736 {
737 ATOM atValue;
738
739 /* A string with zero lenght is not acceptatble in AddAtomW but we want to support
740 users passing an empty string meaning they want no theme for the specified window */
741 if(!pszValue[0])
742 pszValue = L"0";
743
744 atValue = AddAtomW(pszValue);
745 if (!atValue)
746 {
747 ERR("AddAtomW for %S failed with last error %d!\n", pszValue, GetLastError());
749 }
750
751 if (!SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp), (LPWSTR)MAKEINTATOM(atValue)))
752 {
753 ERR("SetPropW for atom %d failed with last error %d\n", aProp, GetLastError());
754 if(atValue) DeleteAtom(atValue);
756 }
757 }
758 return S_OK;
759}
760
761static LPWSTR UXTHEME_GetWindowProperty(HWND hwnd, ATOM aProp, LPWSTR pszBuffer, int dwLen)
762{
763 ATOM atValue = (ATOM)(size_t)GetPropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp));
764 if(atValue) {
765 if(GetAtomNameW(atValue, pszBuffer, dwLen))
766 return pszBuffer;
767 TRACE("property defined, but unable to get value\n");
768 }
769 return NULL;
770}
771
773{
774 PUXTHEME_HANDLE pHandle;
775
776 if (!g_bThemeHooksActive || !hTheme || hTheme == INVALID_HANDLE_VALUE)
777 return NULL;
778
780 {
781 ERR("Invalid handle 0x%x!\n", hTheme);
782 return NULL;
783 }
784
785 pHandle = hTheme;
786 return pHandle->pClass;
787}
788
789static HTHEME WINAPI
791{
792 WCHAR szAppBuff[256];
793 WCHAR szClassBuff[256];
794 LPCWSTR pszAppName;
795 LPCWSTR pszUseClassList;
796 HTHEME hTheme = NULL;
797 TRACE("(%p,%s, %x)\n", hwnd, debugstr_w(pszClassList), flags);
798
799 if(!pszClassList)
800 {
802 return NULL;
803 }
804
805 if ((flags & OTD_NONCLIENT) && !(dwThemeAppProperties & STAP_ALLOW_NONCLIENT))
806 {
808 return NULL;
809 }
810
811 if (!(flags & OTD_NONCLIENT) && !(dwThemeAppProperties & STAP_ALLOW_CONTROLS))
812 {
814 return NULL;
815 }
816
817 if (ThemeFile)
818 {
819 pszAppName = UXTHEME_GetWindowProperty(hwnd, atSubAppName, szAppBuff, sizeof(szAppBuff)/sizeof(szAppBuff[0]));
820 /* If SetWindowTheme was used on the window, that overrides the class list passed to this function */
821 pszUseClassList = UXTHEME_GetWindowProperty(hwnd, atSubIdList, szClassBuff, sizeof(szClassBuff)/sizeof(szClassBuff[0]));
822 if(!pszUseClassList)
823 pszUseClassList = pszClassList;
824
825 if (pszUseClassList)
826 {
827 PTHEME_CLASS pClass;
828 PUXTHEME_HANDLE pHandle;
829
830 if (!ThemeFile->classes)
831 MSSTYLES_ParseThemeIni(ThemeFile);
832 pClass = MSSTYLES_OpenThemeClass(ThemeFile, pszAppName, pszUseClassList);
833
834 if (pClass)
835 {
837 if (pHandle)
838 {
839 g_cHandles++;
840 TRACE("Created handle 0x%x for class 0x%x, app %S, class %S. Count: %d\n", pHandle, pClass, pszAppName, pszUseClassList, g_cHandles);
841 pHandle->pClass = pClass;
842 pHandle->Handle.Flags = RTL_HANDLE_VALID;
843 hTheme = pHandle;
844 }
845 else
846 {
848 }
849 }
850 }
851 }
852
853 if(IsWindow(hwnd))
854 {
855 if ((flags & OTD_NONCLIENT) == 0)
856 {
858 }
859 }
860 else
861 {
863 }
864
866
867 TRACE(" = %p\n", hTheme);
868 return hTheme;
869}
870
871/***********************************************************************
872 * OpenThemeDataEx (UXTHEME.61)
873 */
875{
876 return OpenThemeDataInternal(g_ActiveThemeFile, hwnd, pszClassList, flags);
877}
878
879/***********************************************************************
880 * OpenThemeDataFromFile (UXTHEME.16)
881 */
883{
884 return OpenThemeDataInternal((PTHEME_FILE)hThemeFile, hwnd, pszClassList, flags);
885}
886
887/***********************************************************************
888 * OpenThemeData (UXTHEME.@)
889 */
891{
892 return OpenThemeDataInternal(g_ActiveThemeFile, hwnd, pszClassList, 0);
893}
894
895/***********************************************************************
896 * OpenThemeDataForDpi (UXTHEME.@)
897 */
898HTHEME
899WINAPI
901 _In_ HWND hwnd,
902 _In_ LPCWSTR pszClassList,
903 _In_ UINT dpi)
904{
905 FIXME("dpi (%x) is currently ignored", dpi);
906 return OpenThemeDataInternal(g_ActiveThemeFile, hwnd, pszClassList, 0);
907}
908
909/***********************************************************************
910 * GetWindowTheme (UXTHEME.@)
911 *
912 * Retrieve the last theme opened for a window.
913 *
914 * PARAMS
915 * hwnd [I] window to retrieve the theme for
916 *
917 * RETURNS
918 * The most recent theme.
919 */
921{
922 TRACE("(%p)\n", hwnd);
923
924 if(!IsWindow(hwnd))
925 {
927 return NULL;
928 }
929
931}
932
933/***********************************************************************
934 * SetWindowTheme (UXTHEME.@)
935 *
936 * Persistent through the life of the window, even after themes change
937 */
939 LPCWSTR pszSubIdList)
940{
941 HRESULT hr;
942 TRACE("(%p,%s,%s)\n", hwnd, debugstr_w(pszSubAppName),
943 debugstr_w(pszSubIdList));
944
945 if(!IsWindow(hwnd))
946 return E_HANDLE;
947
949 if (!SUCCEEDED(hr))
950 return hr;
951
953 if (!SUCCEEDED(hr))
954 return hr;
955
957 return hr;
958}
959
960#if (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA)
961/***********************************************************************
962 * SetWindowThemeAttribute (UXTHEME.@)
963 */
965WINAPI
967 _In_ HWND hwnd,
968 _In_ enum WINDOWTHEMEATTRIBUTETYPE eAttribute,
969 _In_ PVOID pvAttribute,
970 _In_ DWORD cbAttribute)
971{
972 FIXME("(%p,%d,%p,%ld): stub\n", hwnd, eAttribute, pvAttribute, cbAttribute);
973 return E_NOTIMPL;
974}
975#endif /* (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA) */
976
977/***********************************************************************
978 * GetCurrentThemeName (UXTHEME.@)
979 */
980HRESULT WINAPI GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars,
981 LPWSTR pszColorBuff, int cchMaxColorChars,
982 LPWSTR pszSizeBuff, int cchMaxSizeChars)
983{
984 int cchar;
985
988
989 if (pszThemeFileName && dwMaxNameChars)
990 {
992 if(cchar > dwMaxNameChars)
994 lstrcpynW(pszThemeFileName, g_ActiveThemeFile->szThemeFile, cchar);
995 }
996
997 if (pszColorBuff && cchMaxColorChars)
998 {
1000 if(cchar > cchMaxColorChars)
1002 lstrcpynW(pszColorBuff, g_ActiveThemeFile->pszSelectedColor, cchar);
1003 }
1004
1005 if (pszSizeBuff && cchMaxSizeChars)
1006 {
1008 if(cchar > cchMaxSizeChars)
1010 lstrcpynW(pszSizeBuff, g_ActiveThemeFile->pszSelectedSize, cchar);
1011 }
1012
1013 return S_OK;
1014}
1015
1016/***********************************************************************
1017 * GetThemeAppProperties (UXTHEME.@)
1018 */
1020{
1021 return dwThemeAppProperties;
1022}
1023
1024/***********************************************************************
1025 * SetThemeAppProperties (UXTHEME.@)
1026 */
1028{
1029 TRACE("(0x%08x)\n", dwFlags);
1031}
1032
1033/***********************************************************************
1034 * CloseThemeData (UXTHEME.@)
1035 */
1037{
1038 PUXTHEME_HANDLE pHandle = hTheme;
1039 HRESULT hr;
1040
1041 TRACE("(%p)\n", hTheme);
1042
1044 return E_HANDLE;
1045
1047 if (SUCCEEDED(hr))
1048 {
1050 g_cHandles--;
1051 TRACE("Destroying handle 0x%x for class 0x%x. Count: %d\n", pHandle, pHandle->pClass, g_cHandles);
1052 }
1053 return hr;
1054}
1055
1056/***********************************************************************
1057 * HitTestThemeBackground (UXTHEME.@)
1058 */
1060 int iStateId, DWORD dwOptions,
1061 const RECT *pRect, HRGN hrgn,
1062 POINT ptTest, WORD *pwHitTestCode)
1063{
1064 FIXME("%d %d 0x%08x: stub\n", iPartId, iStateId, dwOptions);
1065 if (!ValidateHandle(hTheme))
1066 return E_HANDLE;
1067 return E_NOTIMPL;
1068}
1069
1070/***********************************************************************
1071 * IsThemePartDefined (UXTHEME.@)
1072 */
1073BOOL WINAPI IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
1074{
1075 PTHEME_CLASS pClass;
1076
1077 TRACE("(%p,%d,%d)\n", hTheme, iPartId, iStateId);
1078
1079 pClass = ValidateHandle(hTheme);
1080 if (!pClass)
1081 {
1083 return FALSE;
1084 }
1085 if(MSSTYLES_FindPartState(pClass, iPartId, iStateId, NULL))
1086 return TRUE;
1087 return FALSE;
1088}
1089
1090/***********************************************************************
1091 * GetThemeDocumentationProperty (UXTHEME.@)
1092 *
1093 * Try and retrieve the documentation property from string resources
1094 * if that fails, get it from the [documentation] section of themes.ini
1095 */
1097 LPCWSTR pszPropertyName,
1098 LPWSTR pszValueBuff,
1099 int cchMaxValChars)
1100{
1101 const WORD wDocToRes[] = {
1102 TMT_DISPLAYNAME,5000,
1103 TMT_TOOLTIP,5001,
1104 TMT_COMPANY,5002,
1105 TMT_AUTHOR,5003,
1106 TMT_COPYRIGHT,5004,
1107 TMT_URL,5005,
1108 TMT_VERSION,5006,
1109 TMT_DESCRIPTION,5007
1110 };
1111
1113 HRESULT hr;
1114 unsigned int i;
1115 int iDocId;
1116 TRACE("(%s,%s,%p,%d)\n", debugstr_w(pszThemeName), debugstr_w(pszPropertyName),
1117 pszValueBuff, cchMaxValChars);
1118
1120 return E_FAIL;
1121
1122 hr = MSSTYLES_OpenThemeFile(pszThemeName, NULL, NULL, &pt);
1123 if(FAILED(hr)) return hr;
1124
1125 /* Try to load from string resources */
1127 if(MSSTYLES_LookupProperty(pszPropertyName, NULL, &iDocId)) {
1128 for(i=0; i<sizeof(wDocToRes)/sizeof(wDocToRes[0]); i+=2) {
1129 if(wDocToRes[i] == iDocId) {
1130 if(LoadStringW(pt->hTheme, wDocToRes[i+1], pszValueBuff, cchMaxValChars)) {
1131 hr = S_OK;
1132 break;
1133 }
1134 }
1135 }
1136 }
1137 /* If loading from string resource failed, try getting it from the theme.ini */
1138 if(FAILED(hr)) {
1141 LPCWSTR lpValue;
1142 DWORD dwLen;
1143 if(UXINI_FindValue(uf, pszPropertyName, &lpValue, &dwLen)) {
1144 lstrcpynW(pszValueBuff, lpValue, min(dwLen+1,cchMaxValChars));
1145 hr = S_OK;
1146 }
1147 }
1148 UXINI_CloseINI(uf);
1149 }
1150
1152 return hr;
1153}
1154
1155/**********************************************************************
1156 * Undocumented functions
1157 */
1158
1159/**********************************************************************
1160 * QueryThemeServices (UXTHEME.1)
1161 *
1162 * RETURNS
1163 * some kind of status flag
1164 */
1166{
1167 FIXME("stub\n");
1168 return 3; /* This is what is returned under XP in most cases */
1169}
1170
1171
1172/**********************************************************************
1173 * OpenThemeFile (UXTHEME.2)
1174 *
1175 * Opens a theme file, which can be used to change the current theme, etc
1176 *
1177 * PARAMS
1178 * pszThemeFileName Path to a msstyles theme file
1179 * pszColorName Color defined in the theme, eg. NormalColor
1180 * pszSizeName Size defined in the theme, eg. NormalSize
1181 * hThemeFile Handle to theme file
1182 *
1183 * RETURNS
1184 * Success: S_OK
1185 * Failure: HRESULT error-code
1186 */
1187HRESULT WINAPI OpenThemeFile(LPCWSTR pszThemeFileName, LPCWSTR pszColorName,
1188 LPCWSTR pszSizeName, HTHEMEFILE *hThemeFile,
1189 DWORD unknown)
1190{
1191 TRACE("(%s,%s,%s,%p,%d)\n", debugstr_w(pszThemeFileName),
1192 debugstr_w(pszColorName), debugstr_w(pszSizeName),
1193 hThemeFile, unknown);
1194
1196 return E_FAIL;
1197
1198 return MSSTYLES_OpenThemeFile(pszThemeFileName, pszColorName, pszSizeName, (PTHEME_FILE*)hThemeFile);
1199}
1200
1201/**********************************************************************
1202 * CloseThemeFile (UXTHEME.3)
1203 *
1204 * Releases theme file handle returned by OpenThemeFile
1205 *
1206 * PARAMS
1207 * hThemeFile Handle to theme file
1208 *
1209 * RETURNS
1210 * Success: S_OK
1211 * Failure: HRESULT error-code
1212 */
1214{
1215 TRACE("(%p)\n", hThemeFile);
1216 MSSTYLES_CloseThemeFile(hThemeFile);
1217 return S_OK;
1218}
1219
1220/**********************************************************************
1221 * ApplyTheme (UXTHEME.4)
1222 *
1223 * Set a theme file to be the currently active theme
1224 *
1225 * PARAMS
1226 * hThemeFile Handle to theme file
1227 * Flags Unknown flag bits
1228 * hWnd Window requesting the theme change
1229 *
1230 * RETURNS
1231 * Success: S_OK
1232 * Failure: HRESULT error-code
1233 */
1234#ifdef __REACTOS__
1236#else
1238#endif
1239{
1240 HRESULT hr;
1241#ifdef __REACTOS__
1242 TRACE("(%p,%#x,%p)\n", hThemeFile, Flags, hWnd);
1243#else
1244 TRACE("(%p,%s,%p)\n", hThemeFile, unknown, hWnd);
1245#endif
1246 hr = UXTHEME_ApplyTheme(hThemeFile);
1248 return hr;
1249}
1250
1251#ifdef __REACTOS__
1252/**********************************************************************
1253 * SetSystemVisualStyle (UXTHEME.65)
1254 */
1255HRESULT WINAPI SetSystemVisualStyle(PCWSTR pszStyleFile, PCWSTR pszColor, PCWSTR pszSize, UINT Flags)
1256{
1257 PTHEME_FILE pThemeFile = NULL;
1258 HRESULT hr;
1259
1260 if (pszStyleFile)
1261 {
1263 return E_FAIL;
1264
1265 if (pszColor && !*pszColor)
1266 pszColor = NULL;
1267 if (pszSize && !*pszSize)
1268 pszSize = NULL;
1269
1270 hr = MSSTYLES_OpenThemeFile(pszStyleFile, pszColor, pszSize, &pThemeFile);
1271 if (FAILED(hr))
1272 return hr;
1273 }
1274 hr = ApplyTheme(pThemeFile, Flags, NULL);
1275
1276 if (pThemeFile)
1277 MSSTYLES_CloseThemeFile(pThemeFile);
1278
1279 return hr;
1280}
1281#endif // __REACTOS__
1282
1283/**********************************************************************
1284 * GetThemeDefaults (UXTHEME.7)
1285 *
1286 * Get the default color & size for a theme
1287 *
1288 * PARAMS
1289 * pszThemeFileName Path to a msstyles theme file
1290 * pszColorName Buffer to receive the default color name
1291 * dwColorNameLen Length, in characters, of color name buffer
1292 * pszSizeName Buffer to receive the default size name
1293 * dwSizeNameLen Length, in characters, of size name buffer
1294 *
1295 * RETURNS
1296 * Success: S_OK
1297 * Failure: HRESULT error-code
1298 */
1299HRESULT WINAPI GetThemeDefaults(LPCWSTR pszThemeFileName, LPWSTR pszColorName,
1300 DWORD dwColorNameLen, LPWSTR pszSizeName,
1301 DWORD dwSizeNameLen)
1302{
1304 HRESULT hr;
1305 TRACE("(%s,%p,%d,%p,%d)\n", debugstr_w(pszThemeFileName),
1306 pszColorName, dwColorNameLen,
1307 pszSizeName, dwSizeNameLen);
1308
1310 return E_FAIL;
1311
1312 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, NULL, &pt);
1313 if(FAILED(hr)) return hr;
1314
1315#ifdef __REACTOS__
1316 if (pszColorName)
1317 lstrcpynW(pszColorName, pt->pszSelectedColor, dwColorNameLen);
1318 if (pszSizeName)
1319 lstrcpynW(pszSizeName, pt->pszSelectedSize, dwSizeNameLen);
1320#else
1321 lstrcpynW(pszColorName, pt->pszSelectedColor, dwColorNameLen);
1322 lstrcpynW(pszSizeName, pt->pszSelectedSize, dwSizeNameLen);
1323#endif
1324
1326 return S_OK;
1327}
1328
1329/**********************************************************************
1330 * EnumThemes (UXTHEME.8)
1331 *
1332 * Enumerate available themes, calls specified EnumThemeProc for each
1333 * theme found. Passes lpData through to callback function.
1334 *
1335 * PARAMS
1336 * pszThemePath Path containing themes
1337 * callback Called for each theme found in path
1338 * lpData Passed through to callback
1339 *
1340 * RETURNS
1341 * Success: S_OK
1342 * Failure: HRESULT error-code
1343 */
1345 LPVOID lpData)
1346{
1347 WCHAR szDir[MAX_PATH];
1349 static const WCHAR szStar[] = {'*','.','*','\0'};
1350 static const WCHAR szFormat[] = {'%','s','%','s','\\','%','s','.','m','s','s','t','y','l','e','s','\0'};
1351 static const WCHAR szDisplayName[] = {'d','i','s','p','l','a','y','n','a','m','e','\0'};
1352 static const WCHAR szTooltip[] = {'t','o','o','l','t','i','p','\0'};
1353 WCHAR szName[60];
1354 WCHAR szTip[60];
1355 HANDLE hFind;
1356 WIN32_FIND_DATAW wfd;
1357 HRESULT hr;
1358 size_t pathLen;
1359
1360 TRACE("(%s,%p,%p)\n", debugstr_w(pszThemePath), callback, lpData);
1361
1362 if(!pszThemePath || !callback)
1363 return E_POINTER;
1364
1365 lstrcpyW(szDir, pszThemePath);
1366 pathLen = lstrlenW (szDir);
1367 if ((pathLen > 0) && (pathLen < MAX_PATH-1) && (szDir[pathLen - 1] != '\\'))
1368 {
1369 szDir[pathLen] = '\\';
1370 szDir[pathLen+1] = 0;
1371 }
1372
1373 lstrcpyW(szPath, szDir);
1374 lstrcatW(szPath, szStar);
1375 TRACE("searching %s\n", debugstr_w(szPath));
1376
1377 hFind = FindFirstFileW(szPath, &wfd);
1378 if(hFind != INVALID_HANDLE_VALUE) {
1379 do {
1380 if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
1381 && !(wfd.cFileName[0] == '.' && ((wfd.cFileName[1] == '.' && wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0))) {
1382 wsprintfW(szPath, szFormat, szDir, wfd.cFileName, wfd.cFileName);
1383
1384 hr = GetThemeDocumentationProperty(szPath, szDisplayName, szName, sizeof(szName)/sizeof(szName[0]));
1385 if(FAILED(hr))
1386 {
1387 ERR("Failed to get theme name from %S\n", szPath);
1388 continue;
1389 }
1390
1391 hr = GetThemeDocumentationProperty(szPath, szTooltip, szTip, sizeof(szTip)/sizeof(szTip[0]));
1392 if (FAILED(hr))
1393 szTip[0] = 0;
1394
1395 TRACE("callback(%s,%s,%s,%p)\n", debugstr_w(szPath), debugstr_w(szName), debugstr_w(szTip), lpData);
1396 if(!callback(NULL, szPath, szName, szTip, NULL, lpData)) {
1397 TRACE("callback ended enum\n");
1398 break;
1399 }
1400 }
1401 } while(FindNextFileW(hFind, &wfd));
1402 FindClose(hFind);
1403 }
1404 return S_OK;
1405}
1406
1407
1408/**********************************************************************
1409 * EnumThemeColors (UXTHEME.9)
1410 *
1411 * Enumerate theme colors available with a particular size
1412 *
1413 * PARAMS
1414 * pszThemeFileName Path to a msstyles theme file
1415 * pszSizeName Theme size to enumerate available colors
1416 * If NULL the default theme size is used
1417 * dwColorNum Color index to retrieve, increment from 0
1418 * pszColorNames Output color names
1419 *
1420 * RETURNS
1421 * S_OK on success
1422 * E_PROP_ID_UNSUPPORTED when dwColorName does not refer to a color
1423 * or when pszSizeName does not refer to a valid size
1424 *
1425 * NOTES
1426 * XP fails with E_POINTER when pszColorNames points to a buffer smaller than
1427 * sizeof(THEMENAMES).
1428 *
1429 * Not very efficient that I'm opening & validating the theme every call, but
1430 * this is undocumented and almost never called..
1431 * (and this is how windows works too)
1432 */
1433HRESULT WINAPI EnumThemeColors(LPWSTR pszThemeFileName, LPWSTR pszSizeName,
1434 DWORD dwColorNum, PTHEMENAMES pszColorNames)
1435{
1437 HRESULT hr;
1438 LPWSTR tmp;
1439 UINT resourceId = dwColorNum + 1000;
1440 TRACE("(%s,%s,%d)\n", debugstr_w(pszThemeFileName),
1441 debugstr_w(pszSizeName), dwColorNum);
1442
1444 return E_FAIL;
1445
1446 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, pszSizeName, &pt);
1447 if(FAILED(hr)) return hr;
1448
1449 tmp = pt->pszAvailColors;
1450 while(dwColorNum && *tmp) {
1451 dwColorNum--;
1452 tmp += lstrlenW(tmp)+1;
1453 }
1454 if(!dwColorNum && *tmp) {
1455 TRACE("%s\n", debugstr_w(tmp));
1456 lstrcpyW(pszColorNames->szName, tmp);
1457 LoadStringW (pt->hTheme, resourceId,
1458 pszColorNames->szDisplayName,
1459 sizeof (pszColorNames->szDisplayName) / sizeof (WCHAR));
1460 LoadStringW (pt->hTheme, resourceId+1000,
1461 pszColorNames->szTooltip,
1462 sizeof (pszColorNames->szTooltip) / sizeof (WCHAR));
1463 }
1464 else
1466
1468 return hr;
1469}
1470
1471/**********************************************************************
1472 * EnumThemeSizes (UXTHEME.10)
1473 *
1474 * Enumerate theme colors available with a particular size
1475 *
1476 * PARAMS
1477 * pszThemeFileName Path to a msstyles theme file
1478 * pszColorName Theme color to enumerate available sizes
1479 * If NULL the default theme color is used
1480 * dwSizeNum Size index to retrieve, increment from 0
1481 * pszSizeNames Output size names
1482 *
1483 * RETURNS
1484 * S_OK on success
1485 * E_PROP_ID_UNSUPPORTED when dwSizeName does not refer to a size
1486 * or when pszColorName does not refer to a valid color
1487 *
1488 * NOTES
1489 * XP fails with E_POINTER when pszSizeNames points to a buffer smaller than
1490 * sizeof(THEMENAMES).
1491 *
1492 * Not very efficient that I'm opening & validating the theme every call, but
1493 * this is undocumented and almost never called..
1494 * (and this is how windows works too)
1495 */
1496HRESULT WINAPI EnumThemeSizes(LPWSTR pszThemeFileName, LPWSTR pszColorName,
1497 DWORD dwSizeNum, PTHEMENAMES pszSizeNames)
1498{
1500 HRESULT hr;
1501 LPWSTR tmp;
1502 UINT resourceId = dwSizeNum + 3000;
1503 TRACE("(%s,%s,%d)\n", debugstr_w(pszThemeFileName),
1504 debugstr_w(pszColorName), dwSizeNum);
1505
1507 return E_FAIL;
1508
1509 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, pszColorName, NULL, &pt);
1510 if(FAILED(hr)) return hr;
1511
1512 tmp = pt->pszAvailSizes;
1513 while(dwSizeNum && *tmp) {
1514 dwSizeNum--;
1515 tmp += lstrlenW(tmp)+1;
1516 }
1517 if(!dwSizeNum && *tmp) {
1518 TRACE("%s\n", debugstr_w(tmp));
1519 lstrcpyW(pszSizeNames->szName, tmp);
1520 LoadStringW (pt->hTheme, resourceId,
1521 pszSizeNames->szDisplayName,
1522 sizeof (pszSizeNames->szDisplayName) / sizeof (WCHAR));
1523 LoadStringW (pt->hTheme, resourceId+1000,
1524 pszSizeNames->szTooltip,
1525 sizeof (pszSizeNames->szTooltip) / sizeof (WCHAR));
1526 }
1527 else
1529
1531 return hr;
1532}
1533
1534/**********************************************************************
1535 * ParseThemeIniFile (UXTHEME.11)
1536 *
1537 * Enumerate data in a theme INI file.
1538 *
1539 * PARAMS
1540 * pszIniFileName Path to a theme ini file
1541 * pszUnknown Cannot be NULL, L"" is valid
1542 * callback Called for each found entry
1543 * lpData Passed through to callback
1544 *
1545 * RETURNS
1546 * S_OK on success
1547 * 0x800706488 (Unknown property) when enumeration is canceled from callback
1548 *
1549 * NOTES
1550 * When pszUnknown is NULL the callback is never called, the value does not seem to serve
1551 * any other purpose
1552 */
1553HRESULT WINAPI ParseThemeIniFile(LPCWSTR pszIniFileName, LPWSTR pszUnknown,
1555{
1556 FIXME("%s %s: stub\n", debugstr_w(pszIniFileName), debugstr_w(pszUnknown));
1557 return E_NOTIMPL;
1558}
1559
1560/**********************************************************************
1561 * CheckThemeSignature (UXTHEME.29)
1562 *
1563 * Validates the signature of a theme file
1564 *
1565 * PARAMS
1566 * pszIniFileName Path to a theme file
1567 *
1568 * RETURNS
1569 * Success: S_OK
1570 * Failure: HRESULT error-code
1571 */
1573{
1575 HRESULT hr;
1576 TRACE("(%s)\n", debugstr_w(pszThemeFileName));
1577
1579 return E_FAIL;
1580
1581 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, NULL, &pt);
1582 if(FAILED(hr))
1583 return hr;
1585 return S_OK;
1586}
static HRGN hrgn
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
HWND hWnd
Definition: settings.c:17
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4799
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1201
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define LoadLibraryW(x)
Definition: compat.h:747
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
UINT WINAPI GetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
Definition: atom.c:589
ATOM WINAPI DeleteAtom(ATOM nAtom)
Definition: atom.c:546
ATOM WINAPI AddAtomW(LPCWSTR lpString)
Definition: atom.c:536
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
Definition: atom.c:444
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: locale.c:1380
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
HRESULT WINAPI GetThemeDocumentationProperty(LPCWSTR pszThemeName, LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars)
Definition: system.c:1096
void UXTHEME_LoadTheme(BOOL bLoad)
Definition: system.c:185
void WINAPI SetThemeAppProperties(DWORD dwFlags)
Definition: system.c:1027
HRESULT WINAPI EnableTheming(BOOL fEnable)
Definition: system.c:697
static BOOL bIsThemeActive(LPCWSTR pszTheme, LPCWSTR pszColor, LPCWSTR pszSize)
Definition: system.c:147
static const WCHAR strColorKey[]
Definition: system.c:294
static const WCHAR keyIconTitleFont[]
Definition: system.c:302
DWORD gdwErrorInfoTlsIndex
Definition: system.c:27
HRESULT WINAPI ParseThemeIniFile(LPCWSTR pszIniFileName, LPWSTR pszUnknown, PARSETHEMEINIFILEPROC callback, LPVOID lpData)
Definition: system.c:1553
DWORD WINAPI GetThemeAppProperties(void)
Definition: system.c:1019
#define NUM_SYS_COLORS
Definition: system.c:316
static void UXTHEME_SaveSystemMetrics(void)
Definition: system.c:479
static const WCHAR szSizeName[]
Definition: system.c:41
static const WCHAR keyNonClientMetrics[]
Definition: system.c:300
static const struct BackupSysParam backupSysParams[]
static LPWSTR UXTHEME_GetWindowProperty(HWND hwnd, ATOM aProp, LPWSTR pszBuffer, int dwLen)
Definition: system.c:761
HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:874
static const WCHAR szThemeManager[]
Definition: system.c:33
static HTHEME WINAPI OpenThemeDataInternal(PTHEME_FILE ThemeFile, HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:790
HINSTANCE hDllInst
Definition: system.c:47
BOOL CALLBACK UXTHEME_broadcast_theme_changed(HWND hWnd, LPARAM enable)
Definition: system.c:70
static const WCHAR szDllName[]
Definition: system.c:43
int g_cHandles
Definition: system.c:59
HTHEME WINAPI OpenThemeDataFromFile(HTHEMEFILE hThemeFile, HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:882
HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList)
Definition: system.c:938
HRESULT(WINAPI * DWMISCOMPOSITIONENABLED)(BOOL *enabled)
Definition: system.c:660
HRESULT WINAPI GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars, LPWSTR pszColorBuff, int cchMaxColorChars, LPWSTR pszSizeBuff, int cchMaxSizeChars)
Definition: system.c:980
RTL_HANDLE_TABLE g_UxThemeHandleTable
Definition: system.c:58
static ATOM atSubIdList
Definition: system.c:53
ATOM atWndContext
Definition: system.c:54
DWORD WINAPI QueryThemeServices(void)
Definition: system.c:1165
static HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf)
Definition: system.c:134
HRESULT WINAPI ApplyTheme(HTHEMEFILE hThemeFile, char *unknown, HWND hWnd)
Definition: system.c:1237
static void UXTHEME_RestoreSystemMetrics(void)
Definition: system.c:389
BOOL WINAPI IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
Definition: system.c:1073
static const WCHAR szIniDocumentation[]
Definition: system.c:45
static HRESULT UXTHEME_SetWindowProperty(HWND hwnd, ATOM aProp, LPCWSTR pszValue)
Definition: system.c:727
HRESULT WINAPI OpenThemeFile(LPCWSTR pszThemeFileName, LPCWSTR pszColorName, LPCWSTR pszSizeName, HTHEMEFILE *hThemeFile, DWORD unknown)
Definition: system.c:1187
static BOOL CALLBACK UXTHEME_send_theme_changed(HWND hWnd, LPARAM enable)
Definition: system.c:63
HRESULT WINAPI EnumThemeColors(LPWSTR pszThemeFileName, LPWSTR pszSizeName, DWORD dwColorNum, PTHEMENAMES pszColorNames)
Definition: system.c:1433
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:920
HRESULT WINAPI EnumThemeSizes(LPWSTR pszThemeFileName, LPWSTR pszColorName, DWORD dwSizeNum, PTHEMENAMES pszSizeNames)
Definition: system.c:1496
static const WCHAR keyGradientCaption[]
Definition: system.c:298
HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, ENUMTHEMEPROC callback, LPVOID lpData)
Definition: system.c:1344
void UXTHEME_InitSystem(HINSTANCE hInst)
Definition: system.c:577
static const WCHAR szThemeActive[]
Definition: system.c:40
HRESULT WINAPI CloseThemeFile(HTHEMEFILE hThemeFile)
Definition: system.c:1213
ATOM atWindowTheme
Definition: system.c:51
PTHEME_FILE g_ActiveThemeFile
Definition: system.c:56
static ATOM atSubAppName
Definition: system.c:52
static DWORD dwThemeAppProperties
Definition: system.c:50
ATOM atDialogThemeEnabled
Definition: system.c:48
static HRESULT UXTHEME_ApplyTheme(PTHEME_FILE tf)
Definition: system.c:514
static void UXTHEME_BackupSystemMetrics(void)
Definition: system.c:345
static const char *const SysColorsNames[]
Definition: system.c:260
HTHEME WINAPI OpenThemeDataForDpi(_In_ HWND hwnd, _In_ LPCWSTR pszClassList, _In_ UINT dpi)
Definition: system.c:900
BOOL WINAPI IsThemeActive(void)
Definition: system.c:630
HRESULT WINAPI SetWindowThemeAttribute(_In_ HWND hwnd, _In_ enum WINDOWTHEMEATTRIBUTETYPE eAttribute, _In_ PVOID pvAttribute, _In_ DWORD cbAttribute)
Definition: system.c:966
HRESULT WINAPI HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn, POINT ptTest, WORD *pwHitTestCode)
Definition: system.c:1059
static DWORD query_reg_path(HKEY hKey, LPCWSTR lpszValue, LPVOID pvData)
Definition: system.c:86
PTHEME_CLASS ValidateHandle(HTHEME hTheme)
Definition: system.c:772
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:1036
void UXTHEME_UnInitSystem(HINSTANCE hInst)
Definition: system.c:609
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
Definition: system.c:890
static const WCHAR keyFlatMenus[]
Definition: system.c:297
static void save_sys_colors(HKEY baseKey)
Definition: system.c:318
BOOL WINAPI IsAppThemed(void)
Definition: system.c:620
BOOL WINAPI IsCompositionActive(void)
Definition: system.c:665
static const WCHAR szColorName[]
Definition: system.c:42
HRESULT WINAPI GetThemeDefaults(LPCWSTR pszThemeFileName, LPWSTR pszColorName, DWORD dwColorNameLen, LPWSTR pszSizeName, DWORD dwSizeNameLen)
Definition: system.c:1299
HRESULT WINAPI CheckThemeSignature(LPCWSTR pszThemeFileName)
Definition: system.c:1572
#define pt(x, y)
Definition: drawing.c:79
#define RGB(r, g, b)
Definition: precomp.h:71
#define GetBValue(quad)
Definition: precomp.h:75
#define GetGValue(quad)
Definition: precomp.h:74
#define GetRValue(quad)
Definition: precomp.h:73
#define L(x)
Definition: resources.c:13
#define UlongToPtr(u)
Definition: config.h:106
HINSTANCE hInst
Definition: dxdiag.c:13
VOID UXTHEME_DeleteParseErrorInfo(VOID)
Definition: errinfo.c:34
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
FxAutoRegKey hKey
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean enable
Definition: glext.h:11120
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
HFONT tf
Definition: icontest.c:17
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define b
Definition: ke_i.h:79
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
LPCWSTR szPath
Definition: env.c:37
#define sprintf(buf, format,...)
Definition: sprintf.c:55
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static IPrintDialogCallback callback
Definition: printdlg.c:326
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
#define min(a, b)
Definition: monoChain.cc:55
PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext)
Definition: msstyles.c:452
PUXINI_FILE MSSTYLES_GetThemeIni(PTHEME_FILE tf)
Definition: msstyles.c:236
HRESULT MSSTYLES_ReferenceTheme(PTHEME_FILE tf)
Definition: msstyles.c:224
PTHEME_CLASS MSSTYLES_OpenThemeClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassList)
Definition: msstyles.c:756
void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
Definition: msstyles.c:179
HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf)
Definition: msstyles.c:54
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc)
Definition: msstyles.c:822
void MSSTYLES_ParseThemeIni(PTHEME_FILE tf)
Definition: msstyles.c:644
unsigned int UINT
Definition: ndis.h:50
NTSYSAPI VOID NTAPI RtlInitializeHandleTable(_In_ ULONG TableSize, _In_ ULONG HandleSize, _In_ PRTL_HANDLE_TABLE HandleTable)
NTSYSAPI BOOLEAN NTAPI RtlFreeHandle(_In_ PRTL_HANDLE_TABLE HandleTable, _In_ PRTL_HANDLE_TABLE_ENTRY Handle)
NTSYSAPI PRTL_HANDLE_TABLE_ENTRY NTAPI RtlAllocateHandle(_In_ PRTL_HANDLE_TABLE HandleTable, _Inout_ PULONG Index)
NTSYSAPI BOOLEAN NTAPI RtlIsValidHandle(_In_ PRTL_HANDLE_TABLE HandleTable, _In_ PRTL_HANDLE_TABLE_ENTRY Handle)
#define RTL_HANDLE_VALID
Definition: rtltypes.h:370
#define _In_
Definition: no_sal2.h:158
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
static const WCHAR szName[]
Definition: powrprof.c:45
static BOOL bThemeActive
Definition: scroll.c:29
#define REG_DWORD
Definition: sdbapi.c:596
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define memset(x, y, z)
Definition: compat.h:39
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwOptions
Definition: solitaire.cpp:25
const WCHAR * keyName
Definition: system.c:308
Definition: rtltypes.h:1241
ULONG Flags
Definition: rtltypes.h:1244
WCHAR szThemeFile[MAX_PATH]
Definition: uxthemep.h:81
LPWSTR pszAvailColors
Definition: uxthemep.h:82
LPWSTR pszSelectedSize
Definition: uxthemep.h:86
PTHEME_CLASS classes
Definition: uxthemep.h:88
LPWSTR pszAvailSizes
Definition: uxthemep.h:83
LPWSTR pszSelectedColor
Definition: uxthemep.h:85
RTL_HANDLE_TABLE_ENTRY Handle
Definition: uxthemep.h:107
PTHEME_CLASS pClass
Definition: uxthemep.h:108
WCHAR szDisplayName[MAX_PATH+1]
Definition: uxundoc.h:69
WCHAR szName[MAX_PATH+1]
Definition: uxundoc.h:68
WCHAR szTooltip[MAX_PATH+1]
Definition: uxundoc.h:70
BOOL MSSTYLES_LookupProperty(LPCWSTR pszPropertyName, int *dwPrimitive, int *dwId)
Definition: stylemap.c:1100
#define max(a, b)
Definition: svc.c:63
BOOL g_bThemeHooksActive
Definition: themehooks.c:15
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
Definition: pdh_main.c:96
BOOL UXINI_FindSection(PUXINI_FILE uf, LPCWSTR lpName)
Definition: uxini.c:200
BOOL UXINI_FindValue(PUXINI_FILE uf, LPCWSTR lpName, LPCWSTR *lpValue, DWORD *dwValueLen)
Definition: uxini.c:280
void UXINI_CloseINI(PUXINI_FILE uf)
Definition: uxini.c:83
struct _UXTHEME_HANDLE * PUXTHEME_HANDLE
BOOL(CALLBACK * ENUMTHEMEPROC)(LPVOID lpReserved, LPCWSTR pszThemeFileName, LPCWSTR pszThemeName, LPCWSTR pszToolTip, LPVOID lpReserved2, LPVOID lpData)
Definition: uxundoc.h:37
HRESULT WINAPI SetSystemVisualStyle(PCWSTR pszStyleFile, PCWSTR pszColor, PCWSTR pszSize, UINT Flags)
BOOL(CALLBACK * PARSETHEMEINIFILEPROC)(DWORD dwType, LPWSTR pszParam1, LPWSTR pszParam2, LPWSTR pszParam3, DWORD dwParam, LPVOID lpData)
Definition: uxundoc.h:60
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
#define TMT_COMPANY
Definition: vssym32.h:156
#define TMT_DESCRIPTION
Definition: vssym32.h:161
#define TMT_TOOLTIP
Definition: vssym32.h:155
#define TMT_URL
Definition: vssym32.h:159
#define TMT_VERSION
Definition: vssym32.h:160
#define TMT_DISPLAYNAME
Definition: vssym32.h:154
#define TMT_AUTHOR
Definition: vssym32.h:157
#define TMT_COPYRIGHT
Definition: vssym32.h:158
#define dpi
Definition: sysparams.c:23
#define LMEM_ZEROINIT
Definition: winbase.h:408
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define MAKEINTATOM(i)
Definition: winbase.h:1504
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:585
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3749
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
DWORD COLORREF
Definition: windef.h:300
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define E_HANDLE
Definition: winerror.h:2850
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_POINTER
Definition: winerror.h:2365
#define HKEY_CURRENT_USER
Definition: winreg.h:11
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI SetSysColors(_In_ int cElements, _In_reads_(cElements) CONST INT *lpaElements, _In_reads_(cElements) CONST COLORREF *lpaRgbValues)
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1391
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define SPIF_SENDCHANGE
Definition: winuser.h:1591
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1590
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
#define SPI_SETICONTITLELOGFONT
Definition: winuser.h:1394
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193