ReactOS 0.4.17-dev-1321-g5c122a9
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 {
227 /* Drop the theme region once the caption is gone, e.g. when going fullscreen */
229 if (pwndData && pwndData->HasThemeRgn && !pwndData->UpdatingRgn)
230 {
231 pwndData->HasThemeRgn = FALSE;
232 /* Rebuild it once the caption returns, even without a size change */
233 pwndData->DirtyThemeRegion = TRUE;
234 pwndData->UpdatingRgn = TRUE;
236 pwndData->UpdatingRgn = FALSE;
237 }
238 return 0;
239 }
240
241 /* Get theme data for this window */
242 pwndData = ThemeGetWndData(hWnd);
243 if (pwndData == NULL)
244 return 0;
245
246 /* Do not change the region of the window if its size wasn't changed */
247 if ((pWinPos->flags & SWP_NOSIZE) != 0 && pwndData->DirtyThemeRegion == FALSE)
248 return 0;
249
250 /* We don't touch the shape of the window if the application sets it on its own */
251 if (pwndData->HasAppDefinedRgn != FALSE)
252 return 0;
253
254 /* Calling SetWindowRgn will call SetWindowPos again so we need to avoid this recursion */
255 if (pwndData->UpdatingRgn != FALSE)
256 return 0;
257
258 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
259 {
260 if(pwndData->HasThemeRgn)
261 {
262 pwndData->HasThemeRgn = FALSE;
264 }
265 return 0;
266 }
267
268 pwndData->DirtyThemeRegion = FALSE;
269 pwndData->HasThemeRgn = TRUE;
270 pwndData->UpdatingRgn = TRUE;
272 pwndData->UpdatingRgn = FALSE;
273
274 return 0;
275 }
276
277/**********************************************************************
278 * Hook Functions
279 */
280
281static LRESULT CALLBACK
283{
284 PWND_DATA pwndData;
285
287
288 if(!IsAppThemed() ||
289 !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT) ||
290 (pwndData && pwndData->HasAppDefinedRgn))
291 {
293 Msg,
294 wParam,
295 lParam);
296 }
297
298 return ThemeWndProc(hWnd,
299 Msg,
300 wParam,
301 lParam,
303}
304
305static LRESULT CALLBACK
307{
308 PWND_DATA pwndData;
309
311
312 if(!IsAppThemed() ||
313 !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT) ||
314 (pwndData && pwndData->HasAppDefinedRgn))
315 {
317 Msg,
318 wParam,
319 lParam);
320 }
321
322 return ThemeWndProc(hWnd,
323 Msg,
324 wParam,
325 lParam,
327}
328
329static LRESULT CALLBACK
331{
332 switch(Msg)
333 {
334 case WM_CREATE:
335 case WM_STYLECHANGED:
336 case WM_SIZE:
338 {
339 if(IsAppThemed() && (GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
341 break;
342 }
343 case WM_THEMECHANGED:
344 {
345 PWND_DATA pwndData = ThemeGetWndData(hWnd);
346
349
350 if (pwndData == NULL)
351 return 0;
352
353 if (pwndData->hTabBackgroundBrush != NULL)
354 {
356 pwndData->hTabBackgroundBrush = NULL;
357 }
358
359 if (pwndData->hTabBackgroundBmp != NULL)
360 {
362 pwndData->hTabBackgroundBmp = NULL;
363 }
364
365 if (pwndData->hthemeWindow)
366 {
367 CloseThemeData(pwndData->hthemeWindow);
368 pwndData->hthemeWindow = NULL;
369 }
370
371 if (pwndData->hthemeScrollbar)
372 {
374 pwndData->hthemeScrollbar = NULL;
375 }
376
377 if(IsAppThemed() && (GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
379
380 pwndData->DirtyThemeRegion = TRUE;
381 break;
382 }
383 case WM_NCCREATE:
384 {
385 PWND_DATA pwndData = ThemeGetWndData(hWnd);
386 if (pwndData == NULL)
387 return 0;
388 pwndData->DirtyThemeRegion = TRUE;
389 }
390 }
391
392 return 0;
393}
394
395
396static LRESULT CALLBACK
398{
399 switch(Msg)
400 {
402 {
404 }
405 case WM_NCDESTROY:
406 {
408 return 0;
409 }
410 }
411
412 return 0;
413}
414
416{
417 PWND_DATA pwndData;
418
419 pwndData = ThemeGetWndData(hwnd);
420 if (pwndData == NULL)
421 return E_FAIL;
422
423 if (pwndData->hTabBackgroundBrush == NULL)
424 {
426 RECT dummy, bmpRect;
427 BOOL hasImageAlpha;
428 HRESULT hr;
429
430 hr = UXTHEME_LoadImage(theme, 0, TABP_BODY, 0, &dummy, FALSE, &hbmp, &bmpRect, &hasImageAlpha);
431 if (FAILED(hr))
432 return hr;
433
434 if (changeOrigin)
435 {
436 /* Unfortunately SetBrushOrgEx doesn't work at all */
437 RECT rcWindow, rcParent;
438 UINT y;
439 HDC hdcPattern, hdcHackPattern;
440 HBITMAP hbmpOld1, hbmpold2, hbmpHack;
441
442 GetWindowRect(hwnd, &rcWindow);
443 GetWindowRect(GetParent(hwnd), &rcParent);
444 y = (rcWindow.top - rcParent.top) % bmpRect.bottom;
445
446 hdcPattern = CreateCompatibleDC(hdc);
447 hbmpOld1 = (HBITMAP)SelectObject(hdcPattern, hbmp);
448
449 hdcHackPattern = CreateCompatibleDC(hdc);
450 hbmpHack = CreateCompatibleBitmap(hdc, bmpRect.right, bmpRect.bottom);
451 hbmpold2 = (HBITMAP)SelectObject(hdcHackPattern, hbmpHack);
452
453 BitBlt(hdcHackPattern, 0, 0, bmpRect.right, bmpRect.bottom - y, hdcPattern, 0, y, SRCCOPY);
454 BitBlt(hdcHackPattern, 0, bmpRect.bottom - y, bmpRect.right, y, hdcPattern, 0, 0, SRCCOPY);
455
456 hbmpold2 = (HBITMAP)SelectObject(hdcHackPattern, hbmpold2);
457 hbmpOld1 = (HBITMAP)SelectObject(hdcPattern, hbmpOld1);
458
459 DeleteDC(hdcPattern);
460 DeleteDC(hdcHackPattern);
461
462 /* Keep the handle of the bitmap we created so that it can be used later */
463 pwndData->hTabBackgroundBmp = hbmpHack;
464 hbmp = hbmpHack;
465 }
466
467 /* hbmp is cached so there is no need to free it */
469 }
470
471 if (!pwndData->hTabBackgroundBrush)
472 return E_FAIL;
473
474 *result = pwndData->hTabBackgroundBrush;
475 return S_OK;
476}
477
479{
480 RECT rcStatic;
481
482 GetClientRect(hwnd, &rcStatic);
483 FillRect(hdc, &rcStatic, *result);
484
487}
488
489static LRESULT CALLBACK
491{
492 return 0;
493}
494
495static LRESULT CALLBACK
497{
498 switch(Msg)
499 {
500 case WM_CTLCOLORDLG:
501 case WM_CTLCOLORBTN:
503 {
504 HWND hwndTarget = (HWND)lParam;
505 HDC hdc = (HDC)wParam;
506 HBRUSH* phbrush = (HBRUSH*)ret;
507 HTHEME hTheme;
508
509 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
510 break;
511
513 break;
514
515 hTheme = GetWindowTheme(hWnd);
516 if (!hTheme)
517 hTheme = OpenThemeData(hWnd, L"TAB");
518
519 if (!hTheme)
520 break;
521
522 GetDiaogTextureBrush(hTheme, hwndTarget, hdc, phbrush, Msg != WM_CTLCOLORDLG);
523
524#if 1
525 {
526 WCHAR controlClass[32];
527 GetClassNameW (hwndTarget, controlClass, sizeof(controlClass) / sizeof(controlClass[0]));
528
529 /* This is a hack for the static class. Windows have a v6 static class just for this. */
530 if (lstrcmpiW (controlClass, WC_STATICW) == 0)
531 HackFillStaticBg(hwndTarget, hdc, phbrush);
532 }
533#endif
535 break;
536 }
537 }
538
539 return 0;
540}
541
543{
544 PWND_DATA pwndData = ThemeGetWndData(hWnd);
545 if(pwndData)
546 {
547 pwndData->HasAppDefinedRgn = TRUE;
548 pwndData->HasThemeRgn = FALSE;
549 }
550
551 return g_user32ApiHook.SetWindowRgn(hWnd, hRgn, bRedraw);
552}
553
555{
556 PWND_DATA pwndData;
557 DWORD style;
558 BOOL ret;
559
560 /* Avoid creating a window context if it is not needed */
561 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
562 goto dodefault;
563
565 if((style & (WS_HSCROLL|WS_VSCROLL))==0)
566 goto dodefault;
567
568 pwndData = ThemeGetWndData(hwnd);
569 if (pwndData == NULL)
570 goto dodefault;
571
572 /*
573 * Uxtheme needs to handle the tracking of the scrollbar itself
574 * This means than if an application needs to get the track position
575 * with GetScrollInfo, it will get wrong data. So uxtheme needs to
576 * hook it and set the correct tracking position itself
577 */
578 ret = g_user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
579 if ( lpsi &&
580 (lpsi->fMask & SIF_TRACKPOS) &&
581 pwndData->SCROLL_TrackingWin == hwnd &&
582 pwndData->SCROLL_TrackingBar == fnBar)
583 {
584 lpsi->nTrackPos = pwndData->SCROLL_TrackingVal;
585 }
586 return ret;
587
588dodefault:
589 return g_user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
590}
591
593{
594 PWND_DATA pwndData;
595 SCROLLINFO siout;
596 LPSCROLLINFO lpsiout = &siout;
597 BOOL IsThemed = FALSE;
598
599 pwndData = ThemeGetWndData(hWnd);
600
601 if (!pwndData)
602 goto dodefault;
603
604 if (pwndData->hthemeScrollbar)
605 IsThemed = TRUE;
606
607 memcpy(&siout, lpsi, sizeof(SCROLLINFO));
608 if (IsThemed)
609 siout.fMask |= SIF_THEMED;
610
611dodefault:
612 return g_user32ApiHook.SetScrollInfo(hWnd, fnBar, lpsiout, bRedraw);
613}
614
615/**********************************************************************
616 * Exports
617 */
618
621{
622 if (!puah || State != uahLoadInit)
623 {
627 return TRUE;
628 }
629
631
632 /* Store the original functions from user32 */
633 g_user32ApiHook = *puah;
634
647
651
663 UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_STYLECHANGED);
664 UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_SETICON);
670
677 UAH_HOOK_MESSAGE(puah->WndProcArray, WM_STYLECHANGING);
678 UAH_HOOK_MESSAGE(puah->WndProcArray, WM_STYLECHANGED);
684 UAH_HOOK_MESSAGE(puah->WndProcArray, WM_THEMECHANGED);
686
689
696
698
699 return TRUE;
700}
701
704
707{
708 PVOID lpFunc;
710 BOOL ret;
711
712 lpFunc = GetProcAddress(GetModuleHandle("user32.dll"), "RegisterUserApiHook");
713
714 ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
717
718 if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
719 {
720 PREGISTER_UAH_WINXP lpfuncxp = (PREGISTER_UAH_WINXP)lpFunc;
721 ret = lpfuncxp(hDllInst, ThemeInitApiHook);
722 }
723 else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
724 {
726 USERAPIHOOKINFO uah;
727
728 uah.m_size = sizeof(uah);
729 uah.m_dllname1 = L"uxtheme.dll";
730 uah.m_funname1 = L"ThemeInitApiHook";
731 uah.m_dllname2 = NULL;
732 uah.m_funname2 = NULL;
733
734 ret = lpfunc2003(&uah);
735 }
736 else
737 {
739 ret = FALSE;
740 }
741
743
744 return ret;
745}
746
749{
750 BOOL ret;
751
753
755
756 return ret;
757}
758
759INT WINAPI ClassicSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
760{
762 {
763 return g_user32ApiHook.SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
764 }
765
766 return SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
767}
768
769INT WINAPI ClassicSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
770{
772 {
773 return g_user32ApiHook.SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
774 }
775
776 return SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
777}
778
780{
782 {
783 return g_user32ApiHook.GetSystemMetrics(nIndex);
784 }
785
786 return GetSystemMetrics(nIndex);
787}
788
789BOOL WINAPI ClassicAdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
790{
792 {
793 return g_user32ApiHook.AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
794 }
795
796 return AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
797}
static HRGN hrgn
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
HBITMAP hbmp
HINSTANCE hInstance
Definition: charmap.c:19
struct @1907 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#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:1674
#define GetProcessHeap()
Definition: compat.h:736
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
HANDLE HWND
Definition: compat.h:19
#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:4171
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:1768
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:185
DWORD WINAPI GetThemeAppProperties(void)
Definition: system.c:1019
HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:874
HINSTANCE hDllInst
Definition: system.c:47
BOOL CALLBACK UXTHEME_broadcast_theme_changed(HWND hWnd, LPARAM enable)
Definition: system.c:70
ATOM atWndContext
Definition: system.c:54
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:920
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:1036
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
Definition: system.c:890
BOOL WINAPI IsAppThemed(void)
Definition: system.c:620
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Height *Stride) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Stride)
Definition: common.c:42
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2712
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
unsigned int UINT
Definition: sysinfo.c:13
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define ZeroMemory
Definition: minwinbase.h:31
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#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:88
static HRGN hRgn
Definition: mapping.c:32
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
#define BOOL
Definition: nt_native.h:43
#define WS_CAPTION
Definition: pedump.c:624
#define WS_MAXIMIZE
Definition: pedump.c:623
short WCHAR
Definition: pedump.c:58
#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:4685
#define WM_MDISETMENU
Definition: winuser.h:1850
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1800
#define WM_SYSCOMMAND
Definition: winuser.h:1769
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1689
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1636
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
#define WM_SIZE
Definition: winuser.h:1639
#define SIF_THEMED
Definition: winuser.h:1249
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define WM_NCHITTEST
Definition: winuser.h:1714
#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:2892
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_INITDIALOG
Definition: winuser.h:1767
#define SIF_TRACKPOS
Definition: winuser.h:1248
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1794
#define WM_DRAWITEM
Definition: winuser.h:1673
#define WM_NCCREATE
Definition: winuser.h:1711
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define WM_SETTINGCHANGE
Definition: winuser.h:1657
#define WM_CTLCOLORBTN
Definition: winuser.h:1797
#define WM_SETTEXT
Definition: winuser.h:1645
#define WM_NCMOUSEMOVE
Definition: winuser.h:1719
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_NCACTIVATE
Definition: winuser.h:1716
#define WM_MENUCHAR
Definition: winuser.h:1776
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:1674
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:1712
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:1025
#define WM_NCMOUSELEAVE
Definition: winuser.h:1870
#define GWL_STYLE
Definition: winuser.h:863
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1690
#define WM_CTLCOLORDLG
Definition: winuser.h:1798
#define SM_CYCAPTION
Definition: winuser.h:974
int WINAPI GetSystemMetrics(_In_ int)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
Definition: window.c:929
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1720
#define WM_NCPAINT
Definition: winuser.h:1715
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define TRACE(s)
Definition: solgame.cpp:4
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:237
ULONG dwMajorVersion
Definition: rtltypes.h:238
ULONG dwMinorVersion
Definition: rtltypes.h:239
BYTE * MsgBitArray
Definition: undocuser.h:349
DWORD Size
Definition: undocuser.h:350
LPCWSTR m_funname2
Definition: undocuser.h:399
LPCWSTR m_dllname2
Definition: undocuser.h:398
LPCWSTR m_funname1
Definition: undocuser.h:397
LPCWSTR m_dllname1
Definition: undocuser.h:396
UINT flags
Definition: winuser.h:3702
INT SCROLL_TrackingBar
Definition: uxthemep.h:193
BOOL DirtyThemeRegion
Definition: uxthemep.h:185
HTHEME hthemeWindow
Definition: uxthemep.h:177
BOOL UpdatingRgn
Definition: uxthemep.h:184
HBRUSH hTabBackgroundBrush
Definition: uxthemep.h:186
INT SCROLL_TrackingVal
Definition: uxthemep.h:195
BOOL HasThemeRgn
Definition: uxthemep.h:183
HBITMAP hTabBackgroundBmp
Definition: uxthemep.h:187
HTHEME hthemeScrollbar
Definition: uxthemep.h:178
HWND SCROLL_TrackingWin
Definition: uxthemep.h:192
BOOL HasAppDefinedRgn
Definition: uxthemep.h:182
Definition: style.c:91
SYSTEMPARAMETERSINFOA SystemParametersInfoA
Definition: undocuser.h:375
WNDPROC_OWP PostWndProc
Definition: undocuser.h:369
SETWINDOWRGN SetWindowRgn
Definition: undocuser.h:367
WNDPROC_OWP PreWndProc
Definition: undocuser.h:368
UAHOWP WndProcArray
Definition: undocuser.h:370
GETSCROLLINFO GetScrollInfo
Definition: undocuser.h:363
SYSTEMPARAMETERSINFOW SystemParametersInfoW
Definition: undocuser.h:376
GETSYSTEMMETRICS GetSystemMetrics
Definition: undocuser.h:374
UAHOWP DlgProcArray
Definition: undocuser.h:373
UAHOWP DefWndProcArray
Definition: undocuser.h:362
ADJUSTWINDOWRECTEX AdjustWindowRectEx
Definition: undocuser.h:366
WNDPROC DefWindowProcA
Definition: undocuser.h:360
WNDPROC_OWP PreDefDlgProc
Definition: undocuser.h:371
WNDPROC_OWP PostDefDlgProc
Definition: undocuser.h:372
WNDPROC DefWindowProcW
Definition: undocuser.h:361
SETSCROLLINFO SetScrollInfo
Definition: undocuser.h:364
DWORD cbSize
Definition: winuser.h:3874
DWORD dwExStyle
Definition: winuser.h:3878
DWORD dwStyle
Definition: winuser.h:3877
UINT cyWindowBorders
Definition: winuser.h:3881
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:306
BYTE gabMSGPmessages[UAHOWP_MAX_SIZE]
Definition: themehooks.c:13
INT WINAPI ClassicGetSystemMetrics(int nIndex)
Definition: themehooks.c:779
BOOL WINAPI ThemeGetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
Definition: themehooks.c:554
INT WINAPI ThemeSetScrollInfo(HWND hWnd, int fnBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
Definition: themehooks.c:592
BOOL WINAPI ThemeHooksRemove()
Definition: themehooks.c:748
INT WINAPI ClassicSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: themehooks.c:769
static LRESULT CALLBACK ThemePreWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:330
HRESULT GetDiaogTextureBrush(HTHEME theme, HWND hwnd, HDC hdc, HBRUSH *result, BOOL changeOrigin)
Definition: themehooks.c:415
INT WINAPI ClassicSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: themehooks.c:759
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:496
static LRESULT CALLBACK ThemeDlgPreWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:490
BYTE gabDWPmessages[UAHOWP_MAX_SIZE]
Definition: themehooks.c:12
BOOL WINAPI ThemeHooksInstall()
Definition: themehooks.c:706
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:789
static LRESULT CALLBACK ThemePostWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:397
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:542
BOOL(WINAPI * PREGISTER_UAH_WINXP)(HINSTANCE hInstance, USERAPIHOOKPROC CallbackFunc)
Definition: themehooks.c:702
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:282
PWND_DATA ThemeGetWndData(HWND hWnd)
Definition: themehooks.c:17
BOOL CALLBACK ThemeInitApiHook(UAPIHK State, PUSERAPIHOOK puah)
Definition: themehooks.c:620
void HackFillStaticBg(HWND hwnd, HDC hdc, HBRUSH *result)
Definition: themehooks.c:478
BOOL(WINAPI * PREGISTER_UUAH_WIN2003)(PUSERAPIHOOKINFO puah)
Definition: themehooks.c:703
const uint16_t * LPCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WM_UAHINIT
Definition: undocuser.h:63
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:48
enum _UAPIHK UAPIHK
#define UAHOWP_MAX_SIZE
Definition: undocuser.h:355
BOOL WINAPI UnregisterUserApiHook(VOID)
Definition: usrapihk.c:394
BOOL(CALLBACK * USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah)
Definition: undocuser.h:391
@ uahLoadInit
Definition: undocuser.h:386
#define UAH_HOOK_MESSAGE(uahowp, msg)
Definition: undocuser.h:353
#define WM_NCUAHDRAWFRAME
Definition: undocuser.h:49
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
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1207
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define GetModuleHandle
Definition: winbase.h:3550
#define MAKEINTATOM(i)
Definition: winbase.h:1196
#define GetVersionEx
Definition: winbase.h:3575
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
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)
OSVERSIONINFOA OSVERSIONINFO
Definition: rtltypes.h:306
unsigned char BYTE
Definition: xxhash.c:193