ReactOS 0.4.16-dev-1308-gbf734eb
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 }
549 else {
553
554 }
556 }
557 else
558 TRACE("Failed to open theme registry key\n");
559
561
562 return hr;
563}
564
565/***********************************************************************
566 * UXTHEME_InitSystem
567 */
569{
570 static const WCHAR szWindowTheme[] = {
571 'u','x','_','t','h','e','m','e','\0'
572 };
573 static const WCHAR szSubAppName[] = {
574 'u','x','_','s','u','b','a','p','p','\0'
575 };
576 static const WCHAR szSubIdList[] = {
577 'u','x','_','s','u','b','i','d','l','s','t','\0'
578 };
579 static const WCHAR szDialogThemeEnabled[] = {
580 'u','x','_','d','i','a','l','o','g','t','h','e','m','e','\0'
581 };
582
583 hDllInst = hInst;
584
585 atWindowTheme = GlobalAddAtomW(szWindowTheme);
586 atSubAppName = GlobalAddAtomW(szSubAppName);
587 atSubIdList = GlobalAddAtomW(szSubIdList);
588 atDialogThemeEnabled = GlobalAddAtomW(szDialogThemeEnabled);
589 atWndContext = GlobalAddAtomW(L"ux_WndContext");
590
592 g_cHandles = 0;
593
595}
596
597/***********************************************************************
598 * UXTHEME_UnInitSystem
599 */
601{
603
606}
607
608/***********************************************************************
609 * IsAppThemed (UXTHEME.@)
610 */
612{
613 TRACE("\n");
615 return (g_ActiveThemeFile != NULL);
616}
617
618/***********************************************************************
619 * IsThemeActive (UXTHEME.@)
620 */
622{
623 BOOL bActive;
625 HKEY hKey;
626 WCHAR tmp[10];
627 DWORD buffsize;
628
629 TRACE("IsThemeActive\n");
631
633 return TRUE;
634
636 return FALSE;
637
638 bActive = FALSE;
640 if (Result == ERROR_SUCCESS)
641 {
642 buffsize = sizeof(tmp);
643 if (!RegQueryValueExW(hKey, szThemeActive, NULL, NULL, (LPBYTE)tmp, &buffsize))
644 bActive = (tmp[0] != '0');
646 }
647
648 return bActive;
649}
650
652
653/************************************************************
654* IsCompositionActive (UXTHEME.@)
655*/
657{
658 BOOL bIsCompositionActive;
659 DWMISCOMPOSITIONENABLED pDwmIsCompositionEnabled;
660 HMODULE hdwmapi = GetModuleHandleW(L"dwmapi.dll");
661
662 if (!hdwmapi)
663 {
664 hdwmapi = LoadLibraryW(L"dwmapi.dll");
665 if (!hdwmapi)
666 {
667 ERR("Failed to load dwmapi\n");
668 return FALSE;
669 }
670
671 pDwmIsCompositionEnabled = (DWMISCOMPOSITIONENABLED)GetProcAddress(hdwmapi, "DwmIsCompositionEnabled");
672 }
673 if (!pDwmIsCompositionEnabled)
674 return FALSE;
675
676 if (pDwmIsCompositionEnabled(&bIsCompositionActive) == S_OK)
677 return bIsCompositionActive;
678
679 return FALSE;
680}
681
682/***********************************************************************
683 * EnableTheming (UXTHEME.@)
684 *
685 * NOTES
686 * This is a global and persistent change
687 */
689{
690 HKEY hKey;
691 WCHAR szEnabled[] = {'0','\0'};
692
693 TRACE("(%d)\n", fEnable);
694
695 if (fEnable != (g_ActiveThemeFile != NULL)) {
696 if(fEnable)
698 else
701
702 if (fEnable) szEnabled[0] = '1';
704 RegSetValueExW(hKey, szThemeActive, 0, REG_SZ, (LPBYTE)szEnabled, sizeof(WCHAR));
706 }
708 }
709 return S_OK;
710}
711
712/***********************************************************************
713 * UXTHEME_SetWindowProperty
714 *
715 * I'm using atoms as there may be large numbers of duplicated strings
716 * and they do the work of keeping memory down as a cause of that quite nicely
717 */
719{
720 ATOM oldValue = (ATOM)(size_t)RemovePropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp));
721 if(oldValue)
722 {
723 DeleteAtom(oldValue);
724 }
725
726 if(pszValue)
727 {
728 ATOM atValue;
729
730 /* A string with zero lenght is not acceptatble in AddAtomW but we want to support
731 users passing an empty string meaning they want no theme for the specified window */
732 if(!pszValue[0])
733 pszValue = L"0";
734
735 atValue = AddAtomW(pszValue);
736 if (!atValue)
737 {
738 ERR("AddAtomW for %S failed with last error %d!\n", pszValue, GetLastError());
740 }
741
742 if (!SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp), (LPWSTR)MAKEINTATOM(atValue)))
743 {
744 ERR("SetPropW for atom %d failed with last error %d\n", aProp, GetLastError());
745 if(atValue) DeleteAtom(atValue);
747 }
748 }
749 return S_OK;
750}
751
752static LPWSTR UXTHEME_GetWindowProperty(HWND hwnd, ATOM aProp, LPWSTR pszBuffer, int dwLen)
753{
754 ATOM atValue = (ATOM)(size_t)GetPropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp));
755 if(atValue) {
756 if(GetAtomNameW(atValue, pszBuffer, dwLen))
757 return pszBuffer;
758 TRACE("property defined, but unable to get value\n");
759 }
760 return NULL;
761}
762
764{
765 PUXTHEME_HANDLE pHandle;
766
767 if (!g_bThemeHooksActive || !hTheme || hTheme == INVALID_HANDLE_VALUE)
768 return NULL;
769
771 {
772 ERR("Invalid handle 0x%x!\n", hTheme);
773 return NULL;
774 }
775
776 pHandle = hTheme;
777 return pHandle->pClass;
778}
779
780static HTHEME WINAPI
782{
783 WCHAR szAppBuff[256];
784 WCHAR szClassBuff[256];
785 LPCWSTR pszAppName;
786 LPCWSTR pszUseClassList;
787 HTHEME hTheme = NULL;
788 TRACE("(%p,%s, %x)\n", hwnd, debugstr_w(pszClassList), flags);
789
790 if(!pszClassList)
791 {
793 return NULL;
794 }
795
796 if ((flags & OTD_NONCLIENT) && !(dwThemeAppProperties & STAP_ALLOW_NONCLIENT))
797 {
799 return NULL;
800 }
801
802 if (!(flags & OTD_NONCLIENT) && !(dwThemeAppProperties & STAP_ALLOW_CONTROLS))
803 {
805 return NULL;
806 }
807
808 if (ThemeFile)
809 {
810 pszAppName = UXTHEME_GetWindowProperty(hwnd, atSubAppName, szAppBuff, sizeof(szAppBuff)/sizeof(szAppBuff[0]));
811 /* If SetWindowTheme was used on the window, that overrides the class list passed to this function */
812 pszUseClassList = UXTHEME_GetWindowProperty(hwnd, atSubIdList, szClassBuff, sizeof(szClassBuff)/sizeof(szClassBuff[0]));
813 if(!pszUseClassList)
814 pszUseClassList = pszClassList;
815
816 if (pszUseClassList)
817 {
818 PTHEME_CLASS pClass;
819 PUXTHEME_HANDLE pHandle;
820
821 if (!ThemeFile->classes)
822 MSSTYLES_ParseThemeIni(ThemeFile);
823 pClass = MSSTYLES_OpenThemeClass(ThemeFile, pszAppName, pszUseClassList);
824
825 if (pClass)
826 {
828 if (pHandle)
829 {
830 g_cHandles++;
831 TRACE("Created handle 0x%x for class 0x%x, app %S, class %S. Count: %d\n", pHandle, pClass, pszAppName, pszUseClassList, g_cHandles);
832 pHandle->pClass = pClass;
833 pHandle->Handle.Flags = RTL_HANDLE_VALID;
834 hTheme = pHandle;
835 }
836 else
837 {
839 }
840 }
841 }
842 }
843
844 if(IsWindow(hwnd))
845 {
846 if ((flags & OTD_NONCLIENT) == 0)
847 {
849 }
850 }
851 else
852 {
854 }
855
857
858 TRACE(" = %p\n", hTheme);
859 return hTheme;
860}
861
862/***********************************************************************
863 * OpenThemeDataEx (UXTHEME.61)
864 */
866{
867 return OpenThemeDataInternal(g_ActiveThemeFile, hwnd, pszClassList, flags);
868}
869
870/***********************************************************************
871 * OpenThemeDataFromFile (UXTHEME.16)
872 */
874{
875 return OpenThemeDataInternal((PTHEME_FILE)hThemeFile, hwnd, pszClassList, flags);
876}
877
878/***********************************************************************
879 * OpenThemeData (UXTHEME.@)
880 */
882{
883 return OpenThemeDataInternal(g_ActiveThemeFile, hwnd, pszClassList, 0);
884}
885
886/***********************************************************************
887 * OpenThemeDataForDpi (UXTHEME.@)
888 */
889HTHEME
890WINAPI
892 _In_ HWND hwnd,
893 _In_ LPCWSTR pszClassList,
894 _In_ UINT dpi)
895{
896 FIXME("dpi (%x) is currently ignored", dpi);
897 return OpenThemeDataInternal(g_ActiveThemeFile, hwnd, pszClassList, 0);
898}
899
900/***********************************************************************
901 * GetWindowTheme (UXTHEME.@)
902 *
903 * Retrieve the last theme opened for a window.
904 *
905 * PARAMS
906 * hwnd [I] window to retrieve the theme for
907 *
908 * RETURNS
909 * The most recent theme.
910 */
912{
913 TRACE("(%p)\n", hwnd);
914
915 if(!IsWindow(hwnd))
916 {
918 return NULL;
919 }
920
922}
923
924/***********************************************************************
925 * SetWindowTheme (UXTHEME.@)
926 *
927 * Persistent through the life of the window, even after themes change
928 */
930 LPCWSTR pszSubIdList)
931{
932 HRESULT hr;
933 TRACE("(%p,%s,%s)\n", hwnd, debugstr_w(pszSubAppName),
934 debugstr_w(pszSubIdList));
935
936 if(!IsWindow(hwnd))
937 return E_HANDLE;
938
940 if (!SUCCEEDED(hr))
941 return hr;
942
944 if (!SUCCEEDED(hr))
945 return hr;
946
948 return hr;
949}
950
951#if (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA)
952/***********************************************************************
953 * SetWindowThemeAttribute (UXTHEME.@)
954 */
956WINAPI
958 _In_ HWND hwnd,
959 _In_ enum WINDOWTHEMEATTRIBUTETYPE eAttribute,
960 _In_ PVOID pvAttribute,
961 _In_ DWORD cbAttribute)
962{
963 FIXME("(%p,%d,%p,%ld): stub\n", hwnd, eAttribute, pvAttribute, cbAttribute);
964 return E_NOTIMPL;
965}
966#endif /* (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA) */
967
968/***********************************************************************
969 * GetCurrentThemeName (UXTHEME.@)
970 */
971HRESULT WINAPI GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars,
972 LPWSTR pszColorBuff, int cchMaxColorChars,
973 LPWSTR pszSizeBuff, int cchMaxSizeChars)
974{
975 int cchar;
976
979
980 if (pszThemeFileName && dwMaxNameChars)
981 {
983 if(cchar > dwMaxNameChars)
985 lstrcpynW(pszThemeFileName, g_ActiveThemeFile->szThemeFile, cchar);
986 }
987
988 if (pszColorBuff && cchMaxColorChars)
989 {
991 if(cchar > cchMaxColorChars)
993 lstrcpynW(pszColorBuff, g_ActiveThemeFile->pszSelectedColor, cchar);
994 }
995
996 if (pszSizeBuff && cchMaxSizeChars)
997 {
999 if(cchar > cchMaxSizeChars)
1001 lstrcpynW(pszSizeBuff, g_ActiveThemeFile->pszSelectedSize, cchar);
1002 }
1003
1004 return S_OK;
1005}
1006
1007/***********************************************************************
1008 * GetThemeAppProperties (UXTHEME.@)
1009 */
1011{
1012 return dwThemeAppProperties;
1013}
1014
1015/***********************************************************************
1016 * SetThemeAppProperties (UXTHEME.@)
1017 */
1019{
1020 TRACE("(0x%08x)\n", dwFlags);
1022}
1023
1024/***********************************************************************
1025 * CloseThemeData (UXTHEME.@)
1026 */
1028{
1029 PUXTHEME_HANDLE pHandle = hTheme;
1030 HRESULT hr;
1031
1032 TRACE("(%p)\n", hTheme);
1033
1035 return E_HANDLE;
1036
1038 if (SUCCEEDED(hr))
1039 {
1041 g_cHandles--;
1042 TRACE("Destroying handle 0x%x for class 0x%x. Count: %d\n", pHandle, pHandle->pClass, g_cHandles);
1043 }
1044 return hr;
1045}
1046
1047/***********************************************************************
1048 * HitTestThemeBackground (UXTHEME.@)
1049 */
1051 int iStateId, DWORD dwOptions,
1052 const RECT *pRect, HRGN hrgn,
1053 POINT ptTest, WORD *pwHitTestCode)
1054{
1055 FIXME("%d %d 0x%08x: stub\n", iPartId, iStateId, dwOptions);
1056 if (!ValidateHandle(hTheme))
1057 return E_HANDLE;
1058 return E_NOTIMPL;
1059}
1060
1061/***********************************************************************
1062 * IsThemePartDefined (UXTHEME.@)
1063 */
1064BOOL WINAPI IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
1065{
1066 PTHEME_CLASS pClass;
1067
1068 TRACE("(%p,%d,%d)\n", hTheme, iPartId, iStateId);
1069
1070 pClass = ValidateHandle(hTheme);
1071 if (!pClass)
1072 {
1074 return FALSE;
1075 }
1076 if(MSSTYLES_FindPartState(pClass, iPartId, iStateId, NULL))
1077 return TRUE;
1078 return FALSE;
1079}
1080
1081/***********************************************************************
1082 * GetThemeDocumentationProperty (UXTHEME.@)
1083 *
1084 * Try and retrieve the documentation property from string resources
1085 * if that fails, get it from the [documentation] section of themes.ini
1086 */
1088 LPCWSTR pszPropertyName,
1089 LPWSTR pszValueBuff,
1090 int cchMaxValChars)
1091{
1092 const WORD wDocToRes[] = {
1093 TMT_DISPLAYNAME,5000,
1094 TMT_TOOLTIP,5001,
1095 TMT_COMPANY,5002,
1096 TMT_AUTHOR,5003,
1097 TMT_COPYRIGHT,5004,
1098 TMT_URL,5005,
1099 TMT_VERSION,5006,
1100 TMT_DESCRIPTION,5007
1101 };
1102
1104 HRESULT hr;
1105 unsigned int i;
1106 int iDocId;
1107 TRACE("(%s,%s,%p,%d)\n", debugstr_w(pszThemeName), debugstr_w(pszPropertyName),
1108 pszValueBuff, cchMaxValChars);
1109
1111 return E_FAIL;
1112
1113 hr = MSSTYLES_OpenThemeFile(pszThemeName, NULL, NULL, &pt);
1114 if(FAILED(hr)) return hr;
1115
1116 /* Try to load from string resources */
1118 if(MSSTYLES_LookupProperty(pszPropertyName, NULL, &iDocId)) {
1119 for(i=0; i<sizeof(wDocToRes)/sizeof(wDocToRes[0]); i+=2) {
1120 if(wDocToRes[i] == iDocId) {
1121 if(LoadStringW(pt->hTheme, wDocToRes[i+1], pszValueBuff, cchMaxValChars)) {
1122 hr = S_OK;
1123 break;
1124 }
1125 }
1126 }
1127 }
1128 /* If loading from string resource failed, try getting it from the theme.ini */
1129 if(FAILED(hr)) {
1132 LPCWSTR lpValue;
1133 DWORD dwLen;
1134 if(UXINI_FindValue(uf, pszPropertyName, &lpValue, &dwLen)) {
1135 lstrcpynW(pszValueBuff, lpValue, min(dwLen+1,cchMaxValChars));
1136 hr = S_OK;
1137 }
1138 }
1139 UXINI_CloseINI(uf);
1140 }
1141
1143 return hr;
1144}
1145
1146/**********************************************************************
1147 * Undocumented functions
1148 */
1149
1150/**********************************************************************
1151 * QueryThemeServices (UXTHEME.1)
1152 *
1153 * RETURNS
1154 * some kind of status flag
1155 */
1157{
1158 FIXME("stub\n");
1159 return 3; /* This is what is returned under XP in most cases */
1160}
1161
1162
1163/**********************************************************************
1164 * OpenThemeFile (UXTHEME.2)
1165 *
1166 * Opens a theme file, which can be used to change the current theme, etc
1167 *
1168 * PARAMS
1169 * pszThemeFileName Path to a msstyles theme file
1170 * pszColorName Color defined in the theme, eg. NormalColor
1171 * pszSizeName Size defined in the theme, eg. NormalSize
1172 * hThemeFile Handle to theme file
1173 *
1174 * RETURNS
1175 * Success: S_OK
1176 * Failure: HRESULT error-code
1177 */
1178HRESULT WINAPI OpenThemeFile(LPCWSTR pszThemeFileName, LPCWSTR pszColorName,
1179 LPCWSTR pszSizeName, HTHEMEFILE *hThemeFile,
1180 DWORD unknown)
1181{
1182 TRACE("(%s,%s,%s,%p,%d)\n", debugstr_w(pszThemeFileName),
1183 debugstr_w(pszColorName), debugstr_w(pszSizeName),
1184 hThemeFile, unknown);
1185
1187 return E_FAIL;
1188
1189 return MSSTYLES_OpenThemeFile(pszThemeFileName, pszColorName, pszSizeName, (PTHEME_FILE*)hThemeFile);
1190}
1191
1192/**********************************************************************
1193 * CloseThemeFile (UXTHEME.3)
1194 *
1195 * Releases theme file handle returned by OpenThemeFile
1196 *
1197 * PARAMS
1198 * hThemeFile Handle to theme file
1199 *
1200 * RETURNS
1201 * Success: S_OK
1202 * Failure: HRESULT error-code
1203 */
1205{
1206 TRACE("(%p)\n", hThemeFile);
1207 MSSTYLES_CloseThemeFile(hThemeFile);
1208 return S_OK;
1209}
1210
1211/**********************************************************************
1212 * ApplyTheme (UXTHEME.4)
1213 *
1214 * Set a theme file to be the currently active theme
1215 *
1216 * PARAMS
1217 * hThemeFile Handle to theme file
1218 * unknown See notes
1219 * hWnd Window requesting the theme change
1220 *
1221 * RETURNS
1222 * Success: S_OK
1223 * Failure: HRESULT error-code
1224 *
1225 * NOTES
1226 * I'm not sure what the second parameter is (the datatype is likely wrong), other then this:
1227 * Under XP if I pass
1228 * char b[] = "";
1229 * the theme is applied with the screen redrawing really badly (flickers)
1230 * char b[] = "\0"; where \0 can be one or more of any character, makes no difference
1231 * the theme is applied smoothly (screen does not flicker)
1232 * char *b = "\0" or NULL; where \0 can be zero or more of any character, makes no difference
1233 * the function fails returning invalid parameter... very strange
1234 */
1236{
1237 HRESULT hr;
1238 TRACE("(%p,%s,%p)\n", hThemeFile, unknown, hWnd);
1239 hr = UXTHEME_ApplyTheme(hThemeFile);
1241 return hr;
1242}
1243
1244/**********************************************************************
1245 * GetThemeDefaults (UXTHEME.7)
1246 *
1247 * Get the default color & size for a theme
1248 *
1249 * PARAMS
1250 * pszThemeFileName Path to a msstyles theme file
1251 * pszColorName Buffer to receive the default color name
1252 * dwColorNameLen Length, in characters, of color name buffer
1253 * pszSizeName Buffer to receive the default size name
1254 * dwSizeNameLen Length, in characters, of size name buffer
1255 *
1256 * RETURNS
1257 * Success: S_OK
1258 * Failure: HRESULT error-code
1259 */
1260HRESULT WINAPI GetThemeDefaults(LPCWSTR pszThemeFileName, LPWSTR pszColorName,
1261 DWORD dwColorNameLen, LPWSTR pszSizeName,
1262 DWORD dwSizeNameLen)
1263{
1265 HRESULT hr;
1266 TRACE("(%s,%p,%d,%p,%d)\n", debugstr_w(pszThemeFileName),
1267 pszColorName, dwColorNameLen,
1268 pszSizeName, dwSizeNameLen);
1269
1271 return E_FAIL;
1272
1273 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, NULL, &pt);
1274 if(FAILED(hr)) return hr;
1275
1276 lstrcpynW(pszColorName, pt->pszSelectedColor, dwColorNameLen);
1277 lstrcpynW(pszSizeName, pt->pszSelectedSize, dwSizeNameLen);
1278
1280 return S_OK;
1281}
1282
1283/**********************************************************************
1284 * EnumThemes (UXTHEME.8)
1285 *
1286 * Enumerate available themes, calls specified EnumThemeProc for each
1287 * theme found. Passes lpData through to callback function.
1288 *
1289 * PARAMS
1290 * pszThemePath Path containing themes
1291 * callback Called for each theme found in path
1292 * lpData Passed through to callback
1293 *
1294 * RETURNS
1295 * Success: S_OK
1296 * Failure: HRESULT error-code
1297 */
1299 LPVOID lpData)
1300{
1301 WCHAR szDir[MAX_PATH];
1303 static const WCHAR szStar[] = {'*','.','*','\0'};
1304 static const WCHAR szFormat[] = {'%','s','%','s','\\','%','s','.','m','s','s','t','y','l','e','s','\0'};
1305 static const WCHAR szDisplayName[] = {'d','i','s','p','l','a','y','n','a','m','e','\0'};
1306 static const WCHAR szTooltip[] = {'t','o','o','l','t','i','p','\0'};
1307 WCHAR szName[60];
1308 WCHAR szTip[60];
1309 HANDLE hFind;
1310 WIN32_FIND_DATAW wfd;
1311 HRESULT hr;
1312 size_t pathLen;
1313
1314 TRACE("(%s,%p,%p)\n", debugstr_w(pszThemePath), callback, lpData);
1315
1316 if(!pszThemePath || !callback)
1317 return E_POINTER;
1318
1319 lstrcpyW(szDir, pszThemePath);
1320 pathLen = lstrlenW (szDir);
1321 if ((pathLen > 0) && (pathLen < MAX_PATH-1) && (szDir[pathLen - 1] != '\\'))
1322 {
1323 szDir[pathLen] = '\\';
1324 szDir[pathLen+1] = 0;
1325 }
1326
1327 lstrcpyW(szPath, szDir);
1328 lstrcatW(szPath, szStar);
1329 TRACE("searching %s\n", debugstr_w(szPath));
1330
1331 hFind = FindFirstFileW(szPath, &wfd);
1332 if(hFind != INVALID_HANDLE_VALUE) {
1333 do {
1334 if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
1335 && !(wfd.cFileName[0] == '.' && ((wfd.cFileName[1] == '.' && wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0))) {
1336 wsprintfW(szPath, szFormat, szDir, wfd.cFileName, wfd.cFileName);
1337
1338 hr = GetThemeDocumentationProperty(szPath, szDisplayName, szName, sizeof(szName)/sizeof(szName[0]));
1339 if(FAILED(hr))
1340 {
1341 ERR("Failed to get theme name from %S\n", szPath);
1342 continue;
1343 }
1344
1345 hr = GetThemeDocumentationProperty(szPath, szTooltip, szTip, sizeof(szTip)/sizeof(szTip[0]));
1346 if (FAILED(hr))
1347 szTip[0] = 0;
1348
1349 TRACE("callback(%s,%s,%s,%p)\n", debugstr_w(szPath), debugstr_w(szName), debugstr_w(szTip), lpData);
1350 if(!callback(NULL, szPath, szName, szTip, NULL, lpData)) {
1351 TRACE("callback ended enum\n");
1352 break;
1353 }
1354 }
1355 } while(FindNextFileW(hFind, &wfd));
1356 FindClose(hFind);
1357 }
1358 return S_OK;
1359}
1360
1361
1362/**********************************************************************
1363 * EnumThemeColors (UXTHEME.9)
1364 *
1365 * Enumerate theme colors available with a particular size
1366 *
1367 * PARAMS
1368 * pszThemeFileName Path to a msstyles theme file
1369 * pszSizeName Theme size to enumerate available colors
1370 * If NULL the default theme size is used
1371 * dwColorNum Color index to retrieve, increment from 0
1372 * pszColorNames Output color names
1373 *
1374 * RETURNS
1375 * S_OK on success
1376 * E_PROP_ID_UNSUPPORTED when dwColorName does not refer to a color
1377 * or when pszSizeName does not refer to a valid size
1378 *
1379 * NOTES
1380 * XP fails with E_POINTER when pszColorNames points to a buffer smaller than
1381 * sizeof(THEMENAMES).
1382 *
1383 * Not very efficient that I'm opening & validating the theme every call, but
1384 * this is undocumented and almost never called..
1385 * (and this is how windows works too)
1386 */
1387HRESULT WINAPI EnumThemeColors(LPWSTR pszThemeFileName, LPWSTR pszSizeName,
1388 DWORD dwColorNum, PTHEMENAMES pszColorNames)
1389{
1391 HRESULT hr;
1392 LPWSTR tmp;
1393 UINT resourceId = dwColorNum + 1000;
1394 TRACE("(%s,%s,%d)\n", debugstr_w(pszThemeFileName),
1395 debugstr_w(pszSizeName), dwColorNum);
1396
1398 return E_FAIL;
1399
1400 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, pszSizeName, &pt);
1401 if(FAILED(hr)) return hr;
1402
1403 tmp = pt->pszAvailColors;
1404 while(dwColorNum && *tmp) {
1405 dwColorNum--;
1406 tmp += lstrlenW(tmp)+1;
1407 }
1408 if(!dwColorNum && *tmp) {
1409 TRACE("%s\n", debugstr_w(tmp));
1410 lstrcpyW(pszColorNames->szName, tmp);
1411 LoadStringW (pt->hTheme, resourceId,
1412 pszColorNames->szDisplayName,
1413 sizeof (pszColorNames->szDisplayName) / sizeof (WCHAR));
1414 LoadStringW (pt->hTheme, resourceId+1000,
1415 pszColorNames->szTooltip,
1416 sizeof (pszColorNames->szTooltip) / sizeof (WCHAR));
1417 }
1418 else
1420
1422 return hr;
1423}
1424
1425/**********************************************************************
1426 * EnumThemeSizes (UXTHEME.10)
1427 *
1428 * Enumerate theme colors available with a particular size
1429 *
1430 * PARAMS
1431 * pszThemeFileName Path to a msstyles theme file
1432 * pszColorName Theme color to enumerate available sizes
1433 * If NULL the default theme color is used
1434 * dwSizeNum Size index to retrieve, increment from 0
1435 * pszSizeNames Output size names
1436 *
1437 * RETURNS
1438 * S_OK on success
1439 * E_PROP_ID_UNSUPPORTED when dwSizeName does not refer to a size
1440 * or when pszColorName does not refer to a valid color
1441 *
1442 * NOTES
1443 * XP fails with E_POINTER when pszSizeNames points to a buffer smaller than
1444 * sizeof(THEMENAMES).
1445 *
1446 * Not very efficient that I'm opening & validating the theme every call, but
1447 * this is undocumented and almost never called..
1448 * (and this is how windows works too)
1449 */
1450HRESULT WINAPI EnumThemeSizes(LPWSTR pszThemeFileName, LPWSTR pszColorName,
1451 DWORD dwSizeNum, PTHEMENAMES pszSizeNames)
1452{
1454 HRESULT hr;
1455 LPWSTR tmp;
1456 UINT resourceId = dwSizeNum + 3000;
1457 TRACE("(%s,%s,%d)\n", debugstr_w(pszThemeFileName),
1458 debugstr_w(pszColorName), dwSizeNum);
1459
1461 return E_FAIL;
1462
1463 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, pszColorName, NULL, &pt);
1464 if(FAILED(hr)) return hr;
1465
1466 tmp = pt->pszAvailSizes;
1467 while(dwSizeNum && *tmp) {
1468 dwSizeNum--;
1469 tmp += lstrlenW(tmp)+1;
1470 }
1471 if(!dwSizeNum && *tmp) {
1472 TRACE("%s\n", debugstr_w(tmp));
1473 lstrcpyW(pszSizeNames->szName, tmp);
1474 LoadStringW (pt->hTheme, resourceId,
1475 pszSizeNames->szDisplayName,
1476 sizeof (pszSizeNames->szDisplayName) / sizeof (WCHAR));
1477 LoadStringW (pt->hTheme, resourceId+1000,
1478 pszSizeNames->szTooltip,
1479 sizeof (pszSizeNames->szTooltip) / sizeof (WCHAR));
1480 }
1481 else
1483
1485 return hr;
1486}
1487
1488/**********************************************************************
1489 * ParseThemeIniFile (UXTHEME.11)
1490 *
1491 * Enumerate data in a theme INI file.
1492 *
1493 * PARAMS
1494 * pszIniFileName Path to a theme ini file
1495 * pszUnknown Cannot be NULL, L"" is valid
1496 * callback Called for each found entry
1497 * lpData Passed through to callback
1498 *
1499 * RETURNS
1500 * S_OK on success
1501 * 0x800706488 (Unknown property) when enumeration is canceled from callback
1502 *
1503 * NOTES
1504 * When pszUnknown is NULL the callback is never called, the value does not seem to serve
1505 * any other purpose
1506 */
1507HRESULT WINAPI ParseThemeIniFile(LPCWSTR pszIniFileName, LPWSTR pszUnknown,
1509{
1510 FIXME("%s %s: stub\n", debugstr_w(pszIniFileName), debugstr_w(pszUnknown));
1511 return E_NOTIMPL;
1512}
1513
1514/**********************************************************************
1515 * CheckThemeSignature (UXTHEME.29)
1516 *
1517 * Validates the signature of a theme file
1518 *
1519 * PARAMS
1520 * pszIniFileName Path to a theme file
1521 *
1522 * RETURNS
1523 * Success: S_OK
1524 * Failure: HRESULT error-code
1525 */
1527{
1529 HRESULT hr;
1530 TRACE("(%s)\n", debugstr_w(pszThemeFileName));
1531
1533 return E_FAIL;
1534
1535 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, NULL, &pt);
1536 if(FAILED(hr))
1537 return hr;
1539 return S_OK;
1540}
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
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:1087
void UXTHEME_LoadTheme(BOOL bLoad)
Definition: system.c:185
void WINAPI SetThemeAppProperties(DWORD dwFlags)
Definition: system.c:1018
HRESULT WINAPI EnableTheming(BOOL fEnable)
Definition: system.c:688
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:1507
DWORD WINAPI GetThemeAppProperties(void)
Definition: system.c:1010
#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:752
HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:865
static const WCHAR szThemeManager[]
Definition: system.c:33
static HTHEME WINAPI OpenThemeDataInternal(PTHEME_FILE ThemeFile, HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:781
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:873
HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList)
Definition: system.c:929
HRESULT(WINAPI * DWMISCOMPOSITIONENABLED)(BOOL *enabled)
Definition: system.c:651
HRESULT WINAPI GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars, LPWSTR pszColorBuff, int cchMaxColorChars, LPWSTR pszSizeBuff, int cchMaxSizeChars)
Definition: system.c:971
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:1156
static HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf)
Definition: system.c:134
HRESULT WINAPI ApplyTheme(HTHEMEFILE hThemeFile, char *unknown, HWND hWnd)
Definition: system.c:1235
static void UXTHEME_RestoreSystemMetrics(void)
Definition: system.c:389
BOOL WINAPI IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
Definition: system.c:1064
static const WCHAR szIniDocumentation[]
Definition: system.c:45
static HRESULT UXTHEME_SetWindowProperty(HWND hwnd, ATOM aProp, LPCWSTR pszValue)
Definition: system.c:718
HRESULT WINAPI OpenThemeFile(LPCWSTR pszThemeFileName, LPCWSTR pszColorName, LPCWSTR pszSizeName, HTHEMEFILE *hThemeFile, DWORD unknown)
Definition: system.c:1178
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:1387
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:911
HRESULT WINAPI EnumThemeSizes(LPWSTR pszThemeFileName, LPWSTR pszColorName, DWORD dwSizeNum, PTHEMENAMES pszSizeNames)
Definition: system.c:1450
static const WCHAR keyGradientCaption[]
Definition: system.c:298
HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, ENUMTHEMEPROC callback, LPVOID lpData)
Definition: system.c:1298
void UXTHEME_InitSystem(HINSTANCE hInst)
Definition: system.c:568
static const WCHAR szThemeActive[]
Definition: system.c:40
HRESULT WINAPI CloseThemeFile(HTHEMEFILE hThemeFile)
Definition: system.c:1204
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:891
BOOL WINAPI IsThemeActive(void)
Definition: system.c:621
HRESULT WINAPI SetWindowThemeAttribute(_In_ HWND hwnd, _In_ enum WINDOWTHEMEATTRIBUTETYPE eAttribute, _In_ PVOID pvAttribute, _In_ DWORD cbAttribute)
Definition: system.c:957
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:1050
static DWORD query_reg_path(HKEY hKey, LPCWSTR lpszValue, LPVOID pvData)
Definition: system.c:86
PTHEME_CLASS ValidateHandle(HTHEME hTheme)
Definition: system.c:763
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:1027
void UXTHEME_UnInitSystem(HINSTANCE hInst)
Definition: system.c:600
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
Definition: system.c:881
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:611
BOOL WINAPI IsCompositionActive(void)
Definition: system.c:656
static const WCHAR szColorName[]
Definition: system.c:42
HRESULT WINAPI GetThemeDefaults(LPCWSTR pszThemeFileName, LPWSTR pszColorName, DWORD dwColorNameLen, LPWSTR pszSizeName, DWORD dwSizeNameLen)
Definition: system.c:1260
HRESULT WINAPI CheckThemeSignature(LPCWSTR pszThemeFileName)
Definition: system.c:1526
#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 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
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 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
#define L(x)
Definition: ntvdm.h:50
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
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
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
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