ReactOS 0.4.15-dev-8219-ge8b88cf
themehooks.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS uxtheme.dll
4 * FILE: dll/win32/uxtheme/themehooks.c
5 * PURPOSE: uxtheme user api hook functions
6 * PROGRAMMER: Giannis Adamopoulos
7 */
8
9#include "uxthemep.h"
10
16
18{
19 PWND_DATA pwndData;
20
22 if(pwndData == NULL)
23 {
24 pwndData = HeapAlloc(GetProcessHeap(),
26 sizeof(WND_DATA));
27 if(pwndData == NULL)
28 {
29 return NULL;
30 }
31
33 }
34
35 return pwndData;
36}
37
39{
40 PWND_DATA pwndData;
42
43 /*Do not destroy WND_DATA of a window that belong to another process */
46 {
47 return;
48 }
49
51 if(pwndData == NULL)
52 {
53 return;
54 }
55
56 if(pwndData->HasThemeRgn)
57 {
59 }
60
61 if (pwndData->hTabBackgroundBrush != NULL)
62 {
64
66 }
67
68 if (pwndData->hTabBackgroundBmp != NULL)
69 {
71 }
72
73 if (pwndData->hthemeWindow)
74 {
76 }
77
78 if (pwndData->hthemeScrollbar)
79 {
81 }
82
83 HeapFree(GetProcessHeap(), 0, pwndData);
84
86}
87
89{
90 PWND_DATA pwndData;
91
92 /* We only get the theme for the window class if the window has a caption */
93 if((style & WS_CAPTION) != WS_CAPTION)
94 return NULL;
95
96 /* Get theme data for this window */
97 pwndData = ThemeGetWndData(hWnd);
98 if (pwndData == NULL)
99 return NULL;
100
101 if (!(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
102 {
103 if (pwndData->hthemeWindow)
104 {
105 CloseThemeData(pwndData->hthemeWindow);
106 pwndData->hthemeWindow = NULL;
107 }
108 return NULL;
109 }
110
111 /* If the theme data was not cached, open it now */
112 if (!pwndData->hthemeWindow)
113 pwndData->hthemeWindow = OpenThemeDataEx(hWnd, L"WINDOW", OTD_NONCLIENT);
114
115 return pwndData->hthemeWindow;
116}
117
119{
120 PWND_DATA pwndData;
121
122 /* We only get the theme for the scrollbar class if the window has a scrollbar */
123 if((style & (WS_HSCROLL|WS_VSCROLL)) == 0)
124 return NULL;
125
126 /* Get theme data for this window */
127 pwndData = ThemeGetWndData(hWnd);
128 if (pwndData == NULL)
129 return NULL;
130
131 if (!(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
132 {
133 if (pwndData->hthemeScrollbar)
134 {
136 pwndData->hthemeScrollbar = NULL;
137 }
138 return NULL;
139 }
140
141 /* If the theme data was not cached, open it now */
142 if (!pwndData->hthemeScrollbar)
143 pwndData->hthemeScrollbar = OpenThemeDataEx(hWnd, L"SCROLLBAR", OTD_NONCLIENT);
144
145 return pwndData->hthemeScrollbar;
146}
147
149{
151 return TRUE;
152}
153
155{
156 if (hWnd == NULL)
157 {
159 }
160 else
161 {
164 }
165
166 return TRUE;
167}
168
170{
171 HTHEME hTheme;
172 RECT rcWindow;
173 HRGN hrgn, hrgn1;
174 int CaptionHeight, iPart;
175 WINDOWINFO wi;
176
177 TRACE("SetThemeRegion %d\n", hWnd);
178
179 wi.cbSize = sizeof(wi);
180 GetWindowInfo(hWnd, &wi);
181
182 /* Get the caption part id */
183 if (wi.dwStyle & WS_MINIMIZE)
184 iPart = WP_MINCAPTION;
185 else if (wi.dwExStyle & WS_EX_TOOLWINDOW)
186 iPart = WP_SMALLCAPTION;
187 else if (wi.dwStyle & WS_MAXIMIZE)
188 iPart = WP_MAXCAPTION;
189 else
190 iPart = WP_CAPTION;
191
192 CaptionHeight = wi.cyWindowBorders;
194
195 GetWindowRect(hWnd, &rcWindow);
196 rcWindow.right -= rcWindow.left;
197 rcWindow.bottom = CaptionHeight;
198 rcWindow.top = 0;
199 rcWindow.left = 0;
200
201 hTheme = GetNCCaptionTheme(hWnd, wi.dwStyle);
202 GetThemeBackgroundRegion(hTheme, 0, iPart, FS_ACTIVE, &rcWindow, &hrgn);
203
204 GetWindowRect(hWnd, &rcWindow);
205 rcWindow.right -= rcWindow.left;
206 rcWindow.bottom -= rcWindow.top;
207 rcWindow.top = CaptionHeight;
208 rcWindow.left = 0;
209 hrgn1 = CreateRectRgnIndirect(&rcWindow);
210
211 CombineRgn(hrgn, hrgn, hrgn1, RGN_OR );
212
213 DeleteObject(hrgn1);
214
216}
217
219{
220 PWND_DATA pwndData;
221 DWORD style;
222
223 /* We only proceed to change the window shape if it has a caption */
226 return 0;
227
228 /* Get theme data for this window */
229 pwndData = ThemeGetWndData(hWnd);
230 if (pwndData == NULL)
231 return 0;
232
233 /* Do not change the region of the window if its size wasn't changed */
234 if ((pWinPos->flags & SWP_NOSIZE) != 0 && pwndData->DirtyThemeRegion == FALSE)
235 return 0;
236
237 /* We don't touch the shape of the window if the application sets it on its own */
238 if (pwndData->HasAppDefinedRgn != FALSE)
239 return 0;
240
241 /* Calling SetWindowRgn will call SetWindowPos again so we need to avoid this recursion */
242 if (pwndData->UpdatingRgn != FALSE)
243 return 0;
244
245 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
246 {
247 if(pwndData->HasThemeRgn)
248 {
249 pwndData->HasThemeRgn = FALSE;
251 }
252 return 0;
253 }
254
255 pwndData->DirtyThemeRegion = FALSE;
256 pwndData->HasThemeRgn = TRUE;
257 pwndData->UpdatingRgn = TRUE;
259 pwndData->UpdatingRgn = FALSE;
260
261 return 0;
262 }
263
264/**********************************************************************
265 * Hook Functions
266 */
267
268static LRESULT CALLBACK
270{
271 PWND_DATA pwndData;
272
274
275 if(!IsAppThemed() ||
276 !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT) ||
277 (pwndData && pwndData->HasAppDefinedRgn))
278 {
280 Msg,
281 wParam,
282 lParam);
283 }
284
285 return ThemeWndProc(hWnd,
286 Msg,
287 wParam,
288 lParam,
290}
291
292static LRESULT CALLBACK
294{
295 PWND_DATA pwndData;
296
298
299 if(!IsAppThemed() ||
300 !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT) ||
301 (pwndData && pwndData->HasAppDefinedRgn))
302 {
304 Msg,
305 wParam,
306 lParam);
307 }
308
309 return ThemeWndProc(hWnd,
310 Msg,
311 wParam,
312 lParam,
314}
315
316static LRESULT CALLBACK
318{
319 switch(Msg)
320 {
321 case WM_CREATE:
322 case WM_STYLECHANGED:
323 case WM_SIZE:
325 {
326 if(IsAppThemed() && (GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
328 break;
329 }
330 case WM_THEMECHANGED:
331 {
332 PWND_DATA pwndData = ThemeGetWndData(hWnd);
333
336
337 if (pwndData == NULL)
338 return 0;
339
340 if (pwndData->hTabBackgroundBrush != NULL)
341 {
343 pwndData->hTabBackgroundBrush = NULL;
344 }
345
346 if (pwndData->hTabBackgroundBmp != NULL)
347 {
349 pwndData->hTabBackgroundBmp = NULL;
350 }
351
352 if (pwndData->hthemeWindow)
353 {
354 CloseThemeData(pwndData->hthemeWindow);
355 pwndData->hthemeWindow = NULL;
356 }
357
358 if (pwndData->hthemeScrollbar)
359 {
361 pwndData->hthemeScrollbar = NULL;
362 }
363
364 if(IsAppThemed() && (GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
366
367 pwndData->DirtyThemeRegion = TRUE;
368 break;
369 }
370 case WM_NCCREATE:
371 {
372 PWND_DATA pwndData = ThemeGetWndData(hWnd);
373 if (pwndData == NULL)
374 return 0;
375 pwndData->DirtyThemeRegion = TRUE;
376 }
377 }
378
379 return 0;
380}
381
382
383static LRESULT CALLBACK
385{
386 switch(Msg)
387 {
389 {
391 }
392 case WM_NCDESTROY:
393 {
395 return 0;
396 }
397 }
398
399 return 0;
400}
401
403{
404 PWND_DATA pwndData;
405
406 pwndData = ThemeGetWndData(hwnd);
407 if (pwndData == NULL)
408 return E_FAIL;
409
410 if (pwndData->hTabBackgroundBrush == NULL)
411 {
413 RECT dummy, bmpRect;
414 BOOL hasImageAlpha;
415 HRESULT hr;
416
417 hr = UXTHEME_LoadImage(theme, 0, TABP_BODY, 0, &dummy, FALSE, &hbmp, &bmpRect, &hasImageAlpha);
418 if (FAILED(hr))
419 return hr;
420
421 if (changeOrigin)
422 {
423 /* Unfortunately SetBrushOrgEx doesn't work at all */
424 RECT rcWindow, rcParent;
425 UINT y;
426 HDC hdcPattern, hdcHackPattern;
427 HBITMAP hbmpOld1, hbmpold2, hbmpHack;
428
429 GetWindowRect(hwnd, &rcWindow);
430 GetWindowRect(GetParent(hwnd), &rcParent);
431 y = (rcWindow.top - rcParent.top) % bmpRect.bottom;
432
433 hdcPattern = CreateCompatibleDC(hdc);
434 hbmpOld1 = (HBITMAP)SelectObject(hdcPattern, hbmp);
435
436 hdcHackPattern = CreateCompatibleDC(hdc);
437 hbmpHack = CreateCompatibleBitmap(hdc, bmpRect.right, bmpRect.bottom);
438 hbmpold2 = (HBITMAP)SelectObject(hdcHackPattern, hbmpHack);
439
440 BitBlt(hdcHackPattern, 0, 0, bmpRect.right, bmpRect.bottom - y, hdcPattern, 0, y, SRCCOPY);
441 BitBlt(hdcHackPattern, 0, bmpRect.bottom - y, bmpRect.right, y, hdcPattern, 0, 0, SRCCOPY);
442
443 hbmpold2 = (HBITMAP)SelectObject(hdcHackPattern, hbmpold2);
444 hbmpOld1 = (HBITMAP)SelectObject(hdcPattern, hbmpOld1);
445
446 DeleteDC(hdcPattern);
447 DeleteDC(hdcHackPattern);
448
449 /* Keep the handle of the bitmap we created so that it can be used later */
450 pwndData->hTabBackgroundBmp = hbmpHack;
451 hbmp = hbmpHack;
452 }
453
454 /* hbmp is cached so there is no need to free it */
456 }
457
458 if (!pwndData->hTabBackgroundBrush)
459 return E_FAIL;
460
461 *result = pwndData->hTabBackgroundBrush;
462 return S_OK;
463}
464
466{
467 RECT rcStatic;
468
469 GetClientRect(hwnd, &rcStatic);
470 FillRect(hdc, &rcStatic, *result);
471
474}
475
476static LRESULT CALLBACK
478{
479 return 0;
480}
481
482static LRESULT CALLBACK
484{
485 switch(Msg)
486 {
487 case WM_CTLCOLORDLG:
488 case WM_CTLCOLORBTN:
490 {
491 HWND hwndTarget = (HWND)lParam;
492 HDC hdc = (HDC)wParam;
493 HBRUSH* phbrush = (HBRUSH*)ret;
494 HTHEME hTheme;
495
496 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
497 break;
498
500 break;
501
502 hTheme = GetWindowTheme(hWnd);
503 if (!hTheme)
504 hTheme = OpenThemeData(hWnd, L"TAB");
505
506 if (!hTheme)
507 break;
508
509 GetDiaogTextureBrush(hTheme, hwndTarget, hdc, phbrush, Msg != WM_CTLCOLORDLG);
510
511#if 1
512 {
513 WCHAR controlClass[32];
514 GetClassNameW (hwndTarget, controlClass, sizeof(controlClass) / sizeof(controlClass[0]));
515
516 /* This is a hack for the static class. Windows have a v6 static class just for this. */
517 if (lstrcmpiW (controlClass, WC_STATICW) == 0)
518 HackFillStaticBg(hwndTarget, hdc, phbrush);
519 }
520#endif
522 break;
523 }
524 }
525
526 return 0;
527}
528
530{
531 PWND_DATA pwndData = ThemeGetWndData(hWnd);
532 if(pwndData)
533 {
534 pwndData->HasAppDefinedRgn = TRUE;
535 pwndData->HasThemeRgn = FALSE;
536 }
537
538 return g_user32ApiHook.SetWindowRgn(hWnd, hRgn, bRedraw);
539}
540
542{
543 PWND_DATA pwndData;
544 DWORD style;
545 BOOL ret;
546
547 /* Avoid creating a window context if it is not needed */
548 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
549 goto dodefault;
550
552 if((style & (WS_HSCROLL|WS_VSCROLL))==0)
553 goto dodefault;
554
555 pwndData = ThemeGetWndData(hwnd);
556 if (pwndData == NULL)
557 goto dodefault;
558
559 /*
560 * Uxtheme needs to handle the tracking of the scrollbar itself
561 * This means than if an application needs to get the track position
562 * with GetScrollInfo, it will get wrong data. So uxtheme needs to
563 * hook it and set the correct tracking position itself
564 */
565 ret = g_user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
566 if ( lpsi &&
567 (lpsi->fMask & SIF_TRACKPOS) &&
568 pwndData->SCROLL_TrackingWin == hwnd &&
569 pwndData->SCROLL_TrackingBar == fnBar)
570 {
571 lpsi->nTrackPos = pwndData->SCROLL_TrackingVal;
572 }
573 return ret;
574
575dodefault:
576 return g_user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
577}
578
580{
581 PWND_DATA pwndData;
582 SCROLLINFO siout;
583 LPSCROLLINFO lpsiout = &siout;
584 BOOL IsThemed = FALSE;
585
586 pwndData = ThemeGetWndData(hWnd);
587
588 if (!pwndData)
589 goto dodefault;
590
591 if (pwndData->hthemeScrollbar)
592 IsThemed = TRUE;
593
594 memcpy(&siout, lpsi, sizeof(SCROLLINFO));
595 if (IsThemed)
596 siout.fMask |= SIF_THEMED;
597
598dodefault:
599 return g_user32ApiHook.SetScrollInfo(hWnd, fnBar, lpsiout, bRedraw);
600}
601
602/**********************************************************************
603 * Exports
604 */
605
608{
609 if (!puah || State != uahLoadInit)
610 {
614 return TRUE;
615 }
616
618
619 /* Store the original functions from user32 */
620 g_user32ApiHook = *puah;
621
634
638
650 UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_STYLECHANGED);
651 UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_SETICON);
657
664 UAH_HOOK_MESSAGE(puah->WndProcArray, WM_STYLECHANGING);
665 UAH_HOOK_MESSAGE(puah->WndProcArray, WM_STYLECHANGED);
671 UAH_HOOK_MESSAGE(puah->WndProcArray, WM_THEMECHANGED);
673
676
683
685
686 return TRUE;
687}
688
691
694{
695 PVOID lpFunc;
697 BOOL ret;
698
699 lpFunc = GetProcAddress(GetModuleHandle("user32.dll"), "RegisterUserApiHook");
700
701 ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
704
705 if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
706 {
707 PREGISTER_UAH_WINXP lpfuncxp = (PREGISTER_UAH_WINXP)lpFunc;
708 ret = lpfuncxp(hDllInst, ThemeInitApiHook);
709 }
710 else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
711 {
713 USERAPIHOOKINFO uah;
714
715 uah.m_size = sizeof(uah);
716 uah.m_dllname1 = L"uxtheme.dll";
717 uah.m_funname1 = L"ThemeInitApiHook";
718 uah.m_dllname2 = NULL;
719 uah.m_funname2 = NULL;
720
721 ret = lpfunc2003(&uah);
722 }
723 else
724 {
726 ret = FALSE;
727 }
728
730
731 return ret;
732}
733
736{
737 BOOL ret;
738
740
742
743 return ret;
744}
745
746INT WINAPI ClassicSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
747{
749 {
750 return g_user32ApiHook.SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
751 }
752
753 return SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
754}
755
756INT WINAPI ClassicSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
757{
759 {
760 return g_user32ApiHook.SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
761 }
762
763 return SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
764}
765
767{
769 {
770 return g_user32ApiHook.GetSystemMetrics(nIndex);
771 }
772
773 return GetSystemMetrics(nIndex);
774}
775
776BOOL WINAPI ClassicAdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
777{
779 {
780 return g_user32ApiHook.AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
781 }
782
783 return AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
784}
static HRGN hrgn
Arabic default style
Definition: afstyles.h:94
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define UNIMPLEMENTED
Definition: debug.h:118
HBITMAP hbmp
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1643 Msg[]
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define GetProcessHeap()
Definition: compat.h:736
HANDLE HWND
Definition: compat.h:19
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd)
Definition: draw.c:56
HRESULT WINAPI GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion)
Definition: draw.c:1724
HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, BOOL glyph, HBITMAP *hBmp, RECT *bmpRect, BOOL *hasImageAlpha)
Definition: draw.c:230
LRESULT CALLBACK ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndProc)
Definition: nonclient.c:1015
void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme)
Definition: nonclient.c:270
void UXTHEME_LoadTheme(BOOL bLoad)
Definition: system.c:183
DWORD WINAPI GetThemeAppProperties(void)
Definition: system.c:933
HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:819
HINSTANCE hDllInst
Definition: system.c:45
BOOL CALLBACK UXTHEME_broadcast_theme_changed(HWND hWnd, LPARAM enable)
Definition: system.c:68
ATOM atWndContext
Definition: system.c:52
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:851
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
BOOL WINAPI IsAppThemed(void)
Definition: system.c:596
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2711
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint64EXT * result
Definition: glext.h:11304
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HRGN hRgn
Definition: mapping.c:33
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define L(x)
Definition: ntvdm.h:50
#define WS_CAPTION
Definition: pedump.c:624
#define WS_MAXIMIZE
Definition: pedump.c:623
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_MINIMIZE
Definition: pedump.c:622
DWORD * PDWORD
Definition: pedump.c:68
#define WS_HSCROLL
Definition: pedump.c:628
#define WC_STATICW
Definition: commctrl.h:4680
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_PRINTCLIENT
Definition: richedit.h:70
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:237
ULONG dwMajorVersion
Definition: rtltypes.h:238
ULONG dwMinorVersion
Definition: rtltypes.h:239
BYTE * MsgBitArray
Definition: undocuser.h:328
DWORD Size
Definition: undocuser.h:329
LPCWSTR m_funname2
Definition: undocuser.h:378
LPCWSTR m_dllname2
Definition: undocuser.h:377
LPCWSTR m_funname1
Definition: undocuser.h:376
LPCWSTR m_dllname1
Definition: undocuser.h:375
UINT flags
Definition: winuser.h:3594
INT SCROLL_TrackingBar
Definition: uxthemep.h:183
BOOL DirtyThemeRegion
Definition: uxthemep.h:175
HTHEME hthemeWindow
Definition: uxthemep.h:167
BOOL UpdatingRgn
Definition: uxthemep.h:174
HBRUSH hTabBackgroundBrush
Definition: uxthemep.h:176
INT SCROLL_TrackingVal
Definition: uxthemep.h:185
BOOL HasThemeRgn
Definition: uxthemep.h:173
HBITMAP hTabBackgroundBmp
Definition: uxthemep.h:177
HTHEME hthemeScrollbar
Definition: uxthemep.h:168
HWND SCROLL_TrackingWin
Definition: uxthemep.h:182
BOOL HasAppDefinedRgn
Definition: uxthemep.h:172
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
SYSTEMPARAMETERSINFOA SystemParametersInfoA
Definition: undocuser.h:354
WNDPROC_OWP PostWndProc
Definition: undocuser.h:348
SETWINDOWRGN SetWindowRgn
Definition: undocuser.h:346
WNDPROC_OWP PreWndProc
Definition: undocuser.h:347
UAHOWP WndProcArray
Definition: undocuser.h:349
GETSCROLLINFO GetScrollInfo
Definition: undocuser.h:342
SYSTEMPARAMETERSINFOW SystemParametersInfoW
Definition: undocuser.h:355
GETSYSTEMMETRICS GetSystemMetrics
Definition: undocuser.h:353
UAHOWP DlgProcArray
Definition: undocuser.h:352
UAHOWP DefWndProcArray
Definition: undocuser.h:341
ADJUSTWINDOWRECTEX AdjustWindowRectEx
Definition: undocuser.h:345
WNDPROC DefWindowProcA
Definition: undocuser.h:339
WNDPROC_OWP PreDefDlgProc
Definition: undocuser.h:350
WNDPROC_OWP PostDefDlgProc
Definition: undocuser.h:351
WNDPROC DefWindowProcW
Definition: undocuser.h:340
SETSCROLLINFO SetScrollInfo
Definition: undocuser.h:343
DWORD cbSize
Definition: winuser.h:3766
DWORD dwExStyle
Definition: winuser.h:3770
DWORD dwStyle
Definition: winuser.h:3769
UINT cyWindowBorders
Definition: winuser.h:3773
HTHEME GetNCScrollbarTheme(HWND hWnd, DWORD style)
Definition: themehooks.c:118
USERAPIHOOK g_user32ApiHook
Definition: themehooks.c:11
static LRESULT CALLBACK ThemeDefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: themehooks.c:293
BYTE gabMSGPmessages[UAHOWP_MAX_SIZE]
Definition: themehooks.c:13
INT WINAPI ClassicGetSystemMetrics(int nIndex)
Definition: themehooks.c:766
BOOL WINAPI ThemeGetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
Definition: themehooks.c:541
INT WINAPI ThemeSetScrollInfo(HWND hWnd, int fnBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
Definition: themehooks.c:579
BOOL WINAPI ThemeHooksRemove()
Definition: themehooks.c:735
INT WINAPI ClassicSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: themehooks.c:756
static LRESULT CALLBACK ThemePreWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:317
HRESULT GetDiaogTextureBrush(HTHEME theme, HWND hwnd, HDC hdc, HBRUSH *result, BOOL changeOrigin)
Definition: themehooks.c:402
INT WINAPI ClassicSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: themehooks.c:746
int OnPostWinPosChanged(HWND hWnd, WINDOWPOS *pWinPos)
Definition: themehooks.c:218
static LRESULT CALLBACK ThemeDlgPostWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:483
static LRESULT CALLBACK ThemeDlgPreWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:477
BYTE gabDWPmessages[UAHOWP_MAX_SIZE]
Definition: themehooks.c:12
BOOL WINAPI ThemeHooksInstall()
Definition: themehooks.c:693
static BOOL CALLBACK ThemeCleanupChildWndContext(HWND hWnd, LPARAM msg)
Definition: themehooks.c:148
BOOL WINAPI ClassicAdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
Definition: themehooks.c:776
static LRESULT CALLBACK ThemePostWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:384
void SetThemeRegion(HWND hWnd)
Definition: themehooks.c:169
BYTE gabDLGPmessages[UAHOWP_MAX_SIZE]
Definition: themehooks.c:14
static BOOL CALLBACK ThemeCleanupWndContext(HWND hWnd, LPARAM msg)
Definition: themehooks.c:154
int WINAPI ThemeSetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw)
Definition: themehooks.c:529
BOOL(WINAPI * PREGISTER_UAH_WINXP)(HINSTANCE hInstance, USERAPIHOOKPROC CallbackFunc)
Definition: themehooks.c:689
BOOL g_bThemeHooksActive
Definition: themehooks.c:15
HTHEME GetNCCaptionTheme(HWND hWnd, DWORD style)
Definition: themehooks.c:88
void ThemeDestroyWndData(HWND hWnd)
Definition: themehooks.c:38
static LRESULT CALLBACK ThemeDefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: themehooks.c:269
PWND_DATA ThemeGetWndData(HWND hWnd)
Definition: themehooks.c:17
BOOL CALLBACK ThemeInitApiHook(UAPIHK State, PUSERAPIHOOK puah)
Definition: themehooks.c:607
void HackFillStaticBg(HWND hwnd, HDC hdc, HBRUSH *result)
Definition: themehooks.c:465
BOOL(WINAPI * PREGISTER_UUAH_WIN2003)(PUSERAPIHOOKINFO puah)
Definition: themehooks.c:690
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WM_UAHINIT
Definition: undocuser.h:62
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:46
enum _UAPIHK UAPIHK
#define UAHOWP_MAX_SIZE
Definition: undocuser.h:334
BOOL WINAPI UnregisterUserApiHook(VOID)
Definition: usrapihk.c:394
BOOL(CALLBACK * USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah)
Definition: undocuser.h:370
@ uahLoadInit
Definition: undocuser.h:365
#define UAH_HOOK_MESSAGE(uahowp, msg)
Definition: undocuser.h:332
#define WM_NCUAHDRAWFRAME
Definition: undocuser.h:47
struct _WND_DATA * PWND_DATA
OSVERSIONINFO osvi
Definition: ver.c:28
@ TABP_BODY
Definition: vsstyle.h:1227
@ WP_CAPTION
Definition: vsstyle.h:1611
@ WP_MAXCAPTION
Definition: vsstyle.h:1615
@ WP_MINCAPTION
Definition: vsstyle.h:1613
@ WP_SMALLCAPTION
Definition: vsstyle.h:1612
@ FS_ACTIVE
Definition: vsstyle.h:1654
int ret
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define GetModuleHandle
Definition: winbase.h:3827
#define MAKEINTATOM(i)
Definition: winbase.h:1463
#define GetVersionEx
Definition: winbase.h:3852
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
#define TRANSPARENT
Definition: wingdi.h:950
#define SRCCOPY
Definition: wingdi.h:333
#define NULL_BRUSH
Definition: wingdi.h:901
#define RGN_OR
Definition: wingdi.h:359
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
BOOL WINAPI DeleteDC(_In_ HDC)
HBRUSH WINAPI CreatePatternBrush(_In_ HBITMAP)
#define WM_MDISETMENU
Definition: winuser.h:1822
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1772
#define WM_SYSCOMMAND
Definition: winuser.h:1741
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1661
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1608
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
#define WM_SIZE
Definition: winuser.h:1611
#define SIF_THEMED
Definition: winuser.h:1238
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define WM_NCHITTEST
Definition: winuser.h:1686
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define GA_PARENT
Definition: winuser.h:2788
#define SWP_NOSIZE
Definition: winuser.h:1245
#define WM_INITDIALOG
Definition: winuser.h:1739
#define SIF_TRACKPOS
Definition: winuser.h:1237
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1766
#define WM_DRAWITEM
Definition: winuser.h:1645
#define WM_NCCREATE
Definition: winuser.h:1683
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define WM_SETTINGCHANGE
Definition: winuser.h:1629
#define WM_CTLCOLORBTN
Definition: winuser.h:1769
#define WM_SETTEXT
Definition: winuser.h:1617
#define WM_NCMOUSEMOVE
Definition: winuser.h:1691
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_NCACTIVATE
Definition: winuser.h:1688
#define WM_MENUCHAR
Definition: winuser.h:1748
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define WM_MEASUREITEM
Definition: winuser.h:1646
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
HWND WINAPI GetParent(_In_ HWND)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define WM_NCDESTROY
Definition: winuser.h:1684
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
BOOL WINAPI SystemParametersInfoA(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define SM_CYSMCAPTION
Definition: winuser.h:1014
#define WM_NCMOUSELEAVE
Definition: winuser.h:1842
#define GWL_STYLE
Definition: winuser.h:852
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1662
#define WM_CTLCOLORDLG
Definition: winuser.h:1770
#define SM_CYCAPTION
Definition: winuser.h:963
int WINAPI GetSystemMetrics(_In_ int)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1692
#define WM_NCPAINT
Definition: winuser.h:1687
OSVERSIONINFOA OSVERSIONINFO
Definition: rtltypes.h:306
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193