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
11 USERAPIHOOK g_user32ApiHook
;
12 BYTE gabDWPmessages
[UAHOWP_MAX_SIZE
];
13 BYTE gabMSGPmessages
[UAHOWP_MAX_SIZE
];
14 BYTE gabDLGPmessages
[UAHOWP_MAX_SIZE
];
15 BOOL g_bThemeHooksActive
= FALSE
;
17 PWND_DATA
ThemeGetWndData(HWND hWnd
)
21 pwndData
= (PWND_DATA
)GetPropW(hWnd
, (LPCWSTR
)MAKEINTATOM(atWndContext
));
24 pwndData
= HeapAlloc(GetProcessHeap(),
32 SetPropW( hWnd
, (LPCWSTR
)MAKEINTATOM(atWndContext
), pwndData
);
38 void ThemeDestroyWndData(HWND hWnd
)
43 /*Do not destroy WND_DATA of a window that belong to another process */
44 GetWindowThreadProcessId(hWnd
, &ProcessId
);
45 if(ProcessId
!= GetCurrentProcessId())
50 pwndData
= (PWND_DATA
)GetPropW(hWnd
, (LPCWSTR
)MAKEINTATOM(atWndContext
));
56 if(pwndData
->HasThemeRgn
)
58 g_user32ApiHook
.SetWindowRgn(hWnd
, 0, TRUE
);
61 if (pwndData
->hTabBackgroundBrush
!= NULL
)
63 CloseThemeData(GetWindowTheme(hWnd
));
65 DeleteObject(pwndData
->hTabBackgroundBrush
);
68 if (pwndData
->hTabBackgroundBmp
!= NULL
)
70 DeleteObject(pwndData
->hTabBackgroundBmp
);
73 if (pwndData
->hthemeWindow
)
75 CloseThemeData(pwndData
->hthemeWindow
);
78 if (pwndData
->hthemeScrollbar
)
80 CloseThemeData(pwndData
->hthemeScrollbar
);
83 HeapFree(GetProcessHeap(), 0, pwndData
);
85 SetPropW( hWnd
, (LPCWSTR
)MAKEINTATOM(atWndContext
), NULL
);
88 HTHEME
GetNCCaptionTheme(HWND hWnd
, DWORD style
)
92 /* We only get the theme for the window class if the window has a caption */
93 if((style
& WS_CAPTION
) != WS_CAPTION
)
96 /* Get theme data for this window */
97 pwndData
= ThemeGetWndData(hWnd
);
101 if (!(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT
))
103 if (pwndData
->hthemeWindow
)
105 CloseThemeData(pwndData
->hthemeWindow
);
106 pwndData
->hthemeWindow
= NULL
;
111 /* If the theme data was not cached, open it now */
112 if (!pwndData
->hthemeWindow
)
113 pwndData
->hthemeWindow
= OpenThemeDataEx(hWnd
, L
"WINDOW", OTD_NONCLIENT
);
115 return pwndData
->hthemeWindow
;
118 HTHEME
GetNCScrollbarTheme(HWND hWnd
, DWORD style
)
122 /* We only get the theme for the scrollbar class if the window has a scrollbar */
123 if((style
& (WS_HSCROLL
|WS_VSCROLL
)) == 0)
126 /* Get theme data for this window */
127 pwndData
= ThemeGetWndData(hWnd
);
128 if (pwndData
== NULL
)
131 if (!(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT
))
133 if (pwndData
->hthemeScrollbar
)
135 CloseThemeData(pwndData
->hthemeScrollbar
);
136 pwndData
->hthemeScrollbar
= NULL
;
141 /* If the theme data was not cached, open it now */
142 if (!pwndData
->hthemeScrollbar
)
143 pwndData
->hthemeScrollbar
= OpenThemeDataEx(hWnd
, L
"SCROLLBAR", OTD_NONCLIENT
);
145 return pwndData
->hthemeScrollbar
;
148 static BOOL CALLBACK
ThemeCleanupChildWndContext (HWND hWnd
, LPARAM msg
)
150 ThemeDestroyWndData(hWnd
);
154 static BOOL CALLBACK
ThemeCleanupWndContext(HWND hWnd
, LPARAM msg
)
158 EnumWindows (ThemeCleanupWndContext
, 0);
162 ThemeDestroyWndData(hWnd
);
163 EnumChildWindows (hWnd
, ThemeCleanupChildWndContext
, 0);
169 void SetThemeRegion(HWND hWnd
)
174 int CaptionHeight
, iPart
;
177 TRACE("SetThemeRegion %d\n", hWnd
);
179 wi
.cbSize
= sizeof(wi
);
180 GetWindowInfo(hWnd
, &wi
);
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
;
192 CaptionHeight
= wi
.cyWindowBorders
;
193 CaptionHeight
+= GetSystemMetrics(wi
.dwExStyle
& WS_EX_TOOLWINDOW
? SM_CYSMCAPTION
: SM_CYCAPTION
);
195 GetWindowRect(hWnd
, &rcWindow
);
196 rcWindow
.right
-= rcWindow
.left
;
197 rcWindow
.bottom
= CaptionHeight
;
201 hTheme
= GetNCCaptionTheme(hWnd
, wi
.dwStyle
);
202 GetThemeBackgroundRegion(hTheme
, 0, iPart
, FS_ACTIVE
, &rcWindow
, &hrgn
);
204 GetWindowRect(hWnd
, &rcWindow
);
205 rcWindow
.right
-= rcWindow
.left
;
206 rcWindow
.bottom
-= rcWindow
.top
;
207 rcWindow
.top
= CaptionHeight
;
209 hrgn1
= CreateRectRgnIndirect(&rcWindow
);
211 CombineRgn(hrgn
, hrgn
, hrgn1
, RGN_OR
);
215 g_user32ApiHook
.SetWindowRgn(hWnd
, hrgn
, TRUE
);
218 int OnPostWinPosChanged(HWND hWnd
, WINDOWPOS
* pWinPos
)
223 /* We only proceed to change the window shape if it has a caption */
224 style
= GetWindowLongW(hWnd
, GWL_STYLE
);
225 if((style
& WS_CAPTION
)!=WS_CAPTION
)
228 /* Get theme data for this window */
229 pwndData
= ThemeGetWndData(hWnd
);
230 if (pwndData
== NULL
)
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
)
237 /* We don't touch the shape of the window if the application sets it on its own */
238 if (pwndData
->HasAppDefinedRgn
!= FALSE
)
241 /* Calling SetWindowRgn will call SetWindowPos again so we need to avoid this recursion */
242 if (pwndData
->UpdatingRgn
!= FALSE
)
245 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT
))
247 if(pwndData
->HasThemeRgn
)
249 pwndData
->HasThemeRgn
= FALSE
;
250 g_user32ApiHook
.SetWindowRgn(hWnd
, 0, TRUE
);
255 pwndData
->DirtyThemeRegion
= FALSE
;
256 pwndData
->HasThemeRgn
= TRUE
;
257 pwndData
->UpdatingRgn
= TRUE
;
258 SetThemeRegion(hWnd
);
259 pwndData
->UpdatingRgn
= FALSE
;
264 /**********************************************************************
268 static LRESULT CALLBACK
269 ThemeDefWindowProcW(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
)
271 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT
))
273 return g_user32ApiHook
.DefWindowProcW(hWnd
,
279 return ThemeWndProc(hWnd
,
283 g_user32ApiHook
.DefWindowProcW
);
286 static LRESULT CALLBACK
287 ThemeDefWindowProcA(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
)
289 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT
))
291 return g_user32ApiHook
.DefWindowProcA(hWnd
,
297 return ThemeWndProc(hWnd
,
301 g_user32ApiHook
.DefWindowProcA
);
304 static LRESULT CALLBACK
305 ThemePreWindowProc(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
, ULONG_PTR ret
,PDWORD unknown
)
310 case WM_STYLECHANGED
:
312 case WM_WINDOWPOSCHANGED
:
314 ThemeCalculateCaptionButtonsPos(hWnd
, NULL
);
317 case WM_THEMECHANGED
:
319 PWND_DATA pwndData
= ThemeGetWndData(hWnd
);
321 if (GetAncestor(hWnd
, GA_PARENT
) == GetDesktopWindow())
322 UXTHEME_LoadTheme(TRUE
);
324 if (pwndData
== NULL
)
327 if (pwndData
->hTabBackgroundBrush
!= NULL
)
329 DeleteObject(pwndData
->hTabBackgroundBrush
);
330 pwndData
->hTabBackgroundBrush
= NULL
;
333 if (pwndData
->hTabBackgroundBmp
!= NULL
)
335 DeleteObject(pwndData
->hTabBackgroundBmp
);
336 pwndData
->hTabBackgroundBmp
= NULL
;
339 if (pwndData
->hthemeWindow
)
341 CloseThemeData(pwndData
->hthemeWindow
);
342 pwndData
->hthemeWindow
= NULL
;
345 if (pwndData
->hthemeScrollbar
)
347 CloseThemeData(pwndData
->hthemeScrollbar
);
348 pwndData
->hthemeScrollbar
= NULL
;
351 ThemeCalculateCaptionButtonsPos(hWnd
, NULL
);
355 PWND_DATA pwndData
= ThemeGetWndData(hWnd
);
356 if (pwndData
== NULL
)
358 pwndData
->DirtyThemeRegion
= TRUE
;
366 static LRESULT CALLBACK
367 ThemePostWindowProc(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
, ULONG_PTR ret
,PDWORD unknown
)
371 case WM_WINDOWPOSCHANGED
:
373 return OnPostWinPosChanged(hWnd
, (WINDOWPOS
*)lParam
);
377 ThemeDestroyWndData(hWnd
);
385 HRESULT
GetDiaogTextureBrush(HTHEME theme
, HWND hwnd
, HDC hdc
, HBRUSH
* result
, BOOL changeOrigin
)
389 pwndData
= ThemeGetWndData(hwnd
);
390 if (pwndData
== NULL
)
393 if (pwndData
->hTabBackgroundBrush
== NULL
)
400 hr
= UXTHEME_LoadImage(theme
, 0, TABP_BODY
, 0, &dummy
, FALSE
, &hbmp
, &bmpRect
, &hasImageAlpha
);
406 /* Unfortunately SetBrushOrgEx doesn't work at all */
407 RECT rcWindow
, rcParent
;
409 HDC hdcPattern
, hdcHackPattern
;
410 HBITMAP hbmpOld1
, hbmpold2
, hbmpHack
;
412 GetWindowRect(hwnd
, &rcWindow
);
413 GetWindowRect(GetParent(hwnd
), &rcParent
);
414 y
= (rcWindow
.top
- rcParent
.top
) % bmpRect
.bottom
;
416 hdcPattern
= CreateCompatibleDC(hdc
);
417 hbmpOld1
= (HBITMAP
)SelectObject(hdcPattern
, hbmp
);
419 hdcHackPattern
= CreateCompatibleDC(hdc
);
420 hbmpHack
= CreateCompatibleBitmap(hdc
, bmpRect
.right
, bmpRect
.bottom
);
421 hbmpold2
= (HBITMAP
)SelectObject(hdcHackPattern
, hbmpHack
);
423 BitBlt(hdcHackPattern
, 0, 0, bmpRect
.right
, bmpRect
.bottom
- y
, hdcPattern
, 0, y
, SRCCOPY
);
424 BitBlt(hdcHackPattern
, 0, bmpRect
.bottom
- y
, bmpRect
.right
, y
, hdcPattern
, 0, 0, SRCCOPY
);
426 hbmpold2
= (HBITMAP
)SelectObject(hdcHackPattern
, hbmpold2
);
427 hbmpOld1
= (HBITMAP
)SelectObject(hdcPattern
, hbmpOld1
);
429 DeleteDC(hdcPattern
);
430 DeleteDC(hdcHackPattern
);
432 /* Keep the handle of the bitmap we created so that it can be used later */
433 pwndData
->hTabBackgroundBmp
= hbmpHack
;
437 /* hbmp is cached so there is no need to free it */
438 pwndData
->hTabBackgroundBrush
= CreatePatternBrush(hbmp
);
441 if (!pwndData
->hTabBackgroundBrush
)
444 *result
= pwndData
->hTabBackgroundBrush
;
448 void HackFillStaticBg(HWND hwnd
, HDC hdc
, HBRUSH
* result
)
452 GetClientRect(hwnd
, &rcStatic
);
453 FillRect(hdc
, &rcStatic
, *result
);
455 SetBkMode (hdc
, TRANSPARENT
);
456 *result
= GetStockObject (NULL_BRUSH
);
459 static LRESULT CALLBACK
460 ThemeDlgPreWindowProc(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
, ULONG_PTR ret
,PDWORD unknown
)
465 static LRESULT CALLBACK
466 ThemeDlgPostWindowProc(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
, ULONG_PTR ret
,PDWORD unknown
)
472 case WM_CTLCOLORSTATIC
:
474 HWND hwndTarget
= (HWND
)lParam
;
475 HDC hdc
= (HDC
)wParam
;
476 HBRUSH
* phbrush
= (HBRUSH
*)ret
;
479 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT
))
482 if (!IsThemeDialogTextureEnabled (hWnd
))
485 hTheme
= GetWindowTheme(hWnd
);
487 hTheme
= OpenThemeData(hWnd
, L
"TAB");
492 GetDiaogTextureBrush(hTheme
, hwndTarget
, hdc
, phbrush
, Msg
!= WM_CTLCOLORDLG
);
496 WCHAR controlClass
[32];
497 GetClassNameW (hwndTarget
, controlClass
, sizeof(controlClass
) / sizeof(controlClass
[0]));
499 /* This is a hack for the static class. Windows have a v6 static class just for this. */
500 if (lstrcmpiW (controlClass
, WC_STATICW
) == 0)
501 HackFillStaticBg(hwndTarget
, hdc
, phbrush
);
511 int WINAPI
ThemeSetWindowRgn(HWND hWnd
, HRGN hRgn
, BOOL bRedraw
)
513 PWND_DATA pwndData
= ThemeGetWndData(hWnd
);
516 pwndData
->HasAppDefinedRgn
= TRUE
;
517 pwndData
->HasThemeRgn
= FALSE
;
520 return g_user32ApiHook
.SetWindowRgn(hWnd
, hRgn
, bRedraw
);
523 BOOL WINAPI
ThemeGetScrollInfo(HWND hwnd
, int fnBar
, LPSCROLLINFO lpsi
)
529 /* Avoid creating a window context if it is not needed */
530 if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT
))
533 style
= GetWindowLongW(hwnd
, GWL_STYLE
);
534 if((style
& (WS_HSCROLL
|WS_VSCROLL
))==0)
537 pwndData
= ThemeGetWndData(hwnd
);
538 if (pwndData
== NULL
)
542 * Uxtheme needs to handle the tracking of the scrollbar itself
543 * This means than if an application needs to get the track position
544 * with GetScrollInfo, it will get wrong data. So uxtheme needs to
545 * hook it and set the correct tracking position itself
547 ret
= g_user32ApiHook
.GetScrollInfo(hwnd
, fnBar
, lpsi
);
549 (lpsi
->fMask
& SIF_TRACKPOS
) &&
550 pwndData
->SCROLL_TrackingWin
== hwnd
&&
551 pwndData
->SCROLL_TrackingBar
== fnBar
)
553 lpsi
->nTrackPos
= pwndData
->SCROLL_TrackingVal
;
558 return g_user32ApiHook
.GetScrollInfo(hwnd
, fnBar
, lpsi
);
561 /**********************************************************************
566 ThemeInitApiHook(UAPIHK State
, PUSERAPIHOOK puah
)
568 if (!puah
|| State
!= uahLoadInit
)
570 UXTHEME_LoadTheme(FALSE
);
571 ThemeCleanupWndContext(NULL
, 0);
572 g_bThemeHooksActive
= FALSE
;
576 g_bThemeHooksActive
= TRUE
;
578 /* Store the original functions from user32 */
579 g_user32ApiHook
= *puah
;
581 puah
->DefWindowProcA
= ThemeDefWindowProcA
;
582 puah
->DefWindowProcW
= ThemeDefWindowProcW
;
583 puah
->PreWndProc
= ThemePreWindowProc
;
584 puah
->PostWndProc
= ThemePostWindowProc
;
585 puah
->PreDefDlgProc
= ThemeDlgPreWindowProc
;
586 puah
->PostDefDlgProc
= ThemeDlgPostWindowProc
;
587 puah
->DefWndProcArray
.MsgBitArray
= gabDWPmessages
;
588 puah
->DefWndProcArray
.Size
= UAHOWP_MAX_SIZE
;
589 puah
->WndProcArray
.MsgBitArray
= gabMSGPmessages
;
590 puah
->WndProcArray
.Size
= UAHOWP_MAX_SIZE
;
591 puah
->DlgProcArray
.MsgBitArray
= gabDLGPmessages
;
592 puah
->DlgProcArray
.Size
= UAHOWP_MAX_SIZE
;
594 puah
->SetWindowRgn
= ThemeSetWindowRgn
;
595 puah
->GetScrollInfo
= ThemeGetScrollInfo
;
597 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCPAINT
);
598 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCACTIVATE
);
599 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCMOUSEMOVE
);
600 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCMOUSELEAVE
);
601 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCHITTEST
);
602 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCLBUTTONDOWN
);
603 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCUAHDRAWCAPTION
);
604 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCUAHDRAWFRAME
);
605 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_SETTEXT
);
606 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_WINDOWPOSCHANGED
);
607 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_CONTEXTMENU
);
608 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_STYLECHANGED
);
609 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_SETICON
);
610 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_NCDESTROY
);
611 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_SYSCOMMAND
);
612 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_CTLCOLORMSGBOX
);
613 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_CTLCOLORBTN
);
614 UAH_HOOK_MESSAGE(puah
->DefWndProcArray
, WM_CTLCOLORSTATIC
);
616 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_CREATE
);
617 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_SETTINGCHANGE
);
618 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_DRAWITEM
);
619 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_MEASUREITEM
);
620 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_WINDOWPOSCHANGING
);
621 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_WINDOWPOSCHANGED
);
622 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_STYLECHANGING
);
623 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_STYLECHANGED
);
624 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_NCCREATE
);
625 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_NCDESTROY
);
626 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_NCPAINT
);
627 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_MENUCHAR
);
628 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_MDISETMENU
);
629 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_THEMECHANGED
);
630 UAH_HOOK_MESSAGE(puah
->WndProcArray
, WM_UAHINIT
);
632 puah
->DlgProcArray
.MsgBitArray
= gabDLGPmessages
;
633 puah
->DlgProcArray
.Size
= UAHOWP_MAX_SIZE
;
635 UAH_HOOK_MESSAGE(puah
->DlgProcArray
, WM_INITDIALOG
);
636 UAH_HOOK_MESSAGE(puah
->DlgProcArray
, WM_CTLCOLORMSGBOX
);
637 UAH_HOOK_MESSAGE(puah
->DlgProcArray
, WM_CTLCOLORBTN
);
638 UAH_HOOK_MESSAGE(puah
->DlgProcArray
, WM_CTLCOLORDLG
);
639 UAH_HOOK_MESSAGE(puah
->DlgProcArray
, WM_CTLCOLORSTATIC
);
640 UAH_HOOK_MESSAGE(puah
->DlgProcArray
, WM_PRINTCLIENT
);
642 UXTHEME_LoadTheme(TRUE
);
647 typedef BOOL (WINAPI
* PREGISTER_UAH_WINXP
)(HINSTANCE hInstance
, USERAPIHOOKPROC CallbackFunc
);
648 typedef BOOL (WINAPI
* PREGISTER_UUAH_WIN2003
)(PUSERAPIHOOKINFO puah
);
657 lpFunc
= GetProcAddress(GetModuleHandle("user32.dll"), "RegisterUserApiHook");
659 ZeroMemory(&osvi
, sizeof(OSVERSIONINFO
));
660 osvi
.dwOSVersionInfoSize
= sizeof(OSVERSIONINFO
);
663 if ( osvi
.dwMajorVersion
== 5 && osvi
.dwMinorVersion
== 1)
665 PREGISTER_UAH_WINXP lpfuncxp
= (PREGISTER_UAH_WINXP
)lpFunc
;
666 ret
= lpfuncxp(hDllInst
, ThemeInitApiHook
);
668 else if ( osvi
.dwMajorVersion
== 5 && osvi
.dwMinorVersion
== 2)
670 PREGISTER_UUAH_WIN2003 lpfunc2003
= (PREGISTER_UUAH_WIN2003
)lpFunc
;
673 uah
.m_size
= sizeof(uah
);
674 uah
.m_dllname1
= L
"uxtheme.dll";
675 uah
.m_funname1
= L
"ThemeInitApiHook";
676 uah
.m_dllname2
= NULL
;
677 uah
.m_funname2
= NULL
;
679 ret
= lpfunc2003(&uah
);
687 UXTHEME_broadcast_msg (NULL
, WM_THEMECHANGED
);
697 ret
= UnregisterUserApiHook();
699 UXTHEME_broadcast_msg (NULL
, WM_THEMECHANGED
);
704 INT WINAPI
ClassicSystemParametersInfoW(UINT uiAction
, UINT uiParam
, PVOID pvParam
, UINT fWinIni
)
706 if (g_bThemeHooksActive
)
708 return g_user32ApiHook
.SystemParametersInfoW(uiAction
, uiParam
, pvParam
, fWinIni
);
711 return SystemParametersInfoW(uiAction
, uiParam
, pvParam
, fWinIni
);
714 INT WINAPI
ClassicSystemParametersInfoA(UINT uiAction
, UINT uiParam
, PVOID pvParam
, UINT fWinIni
)
716 if (g_bThemeHooksActive
)
718 return g_user32ApiHook
.SystemParametersInfoA(uiAction
, uiParam
, pvParam
, fWinIni
);
721 return SystemParametersInfoA(uiAction
, uiParam
, pvParam
, fWinIni
);
724 INT WINAPI
ClassicGetSystemMetrics(int nIndex
)
726 if (g_bThemeHooksActive
)
728 return g_user32ApiHook
.GetSystemMetrics(nIndex
);
731 return GetSystemMetrics(nIndex
);
734 BOOL WINAPI
ClassicAdjustWindowRectEx(LPRECT lpRect
, DWORD dwStyle
, BOOL bMenu
, DWORD dwExStyle
)
736 if (g_bThemeHooksActive
)
738 return g_user32ApiHook
.AdjustWindowRectEx(lpRect
, dwStyle
, bMenu
, dwExStyle
);
741 return AdjustWindowRectEx(lpRect
, dwStyle
, bMenu
, dwExStyle
);