ReactOS  0.4.14-dev-115-g4576127
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  {
75  CloseThemeData(pwndData->hthemeWindow);
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  {
135  CloseThemeData(pwndData->hthemeScrollbar);
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 */
225  if((style & WS_CAPTION)!=WS_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 
268 static 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 
292 static 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 
316 static LRESULT CALLBACK
318 {
319  switch(Msg)
320  {
321  case WM_CREATE:
322  case WM_STYLECHANGED:
323  case WM_SIZE:
324  case WM_WINDOWPOSCHANGED:
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  {
348  DeleteObject(pwndData->hTabBackgroundBmp);
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  {
360  CloseThemeData(pwndData->hthemeScrollbar);
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 
383 static LRESULT CALLBACK
385 {
386  switch(Msg)
387  {
388  case WM_WINDOWPOSCHANGED:
389  {
391  }
392  case WM_NCDESTROY:
393  {
395  return 0;
396  }
397  }
398 
399  return 0;
400 }
401 
402 HRESULT GetDiaogTextureBrush(HTHEME theme, HWND hwnd, HDC hdc, HBRUSH* result, BOOL changeOrigin)
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  {
412  HBITMAP hbmp;
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 
476 static LRESULT CALLBACK
478 {
479  return 0;
480 }
481 
482 static LRESULT CALLBACK
484 {
485  switch(Msg)
486  {
487  case WM_CTLCOLORDLG:
488  case WM_CTLCOLORBTN:
489  case WM_CTLCOLORSTATIC:
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 
575 dodefault:
576  return g_user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
577 }
578 
579 /**********************************************************************
580  * Exports
581  */
582 
583 BOOL CALLBACK
585 {
586  if (!puah || State != uahLoadInit)
587  {
591  return TRUE;
592  }
593 
595 
596  /* Store the original functions from user32 */
597  g_user32ApiHook = *puah;
598 
611 
614 
626  UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_STYLECHANGED);
627  UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_SETICON);
633 
640  UAH_HOOK_MESSAGE(puah->WndProcArray, WM_STYLECHANGING);
641  UAH_HOOK_MESSAGE(puah->WndProcArray, WM_STYLECHANGED);
647  UAH_HOOK_MESSAGE(puah->WndProcArray, WM_THEMECHANGED);
649 
652 
659 
661 
662  return TRUE;
663 }
664 
667 
668 BOOL WINAPI
670 {
671  PVOID lpFunc;
673  BOOL ret;
674 
675  lpFunc = GetProcAddress(GetModuleHandle("user32.dll"), "RegisterUserApiHook");
676 
677  ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
679  GetVersionEx(&osvi);
680 
681  if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
682  {
683  PREGISTER_UAH_WINXP lpfuncxp = (PREGISTER_UAH_WINXP)lpFunc;
684  ret = lpfuncxp(hDllInst, ThemeInitApiHook);
685  }
686  else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
687  {
688  PREGISTER_UUAH_WIN2003 lpfunc2003 = (PREGISTER_UUAH_WIN2003)lpFunc;
689  USERAPIHOOKINFO uah;
690 
691  uah.m_size = sizeof(uah);
692  uah.m_dllname1 = L"uxtheme.dll";
693  uah.m_funname1 = L"ThemeInitApiHook";
694  uah.m_dllname2 = NULL;
695  uah.m_funname2 = NULL;
696 
697  ret = lpfunc2003(&uah);
698  }
699  else
700  {
702  ret = FALSE;
703  }
704 
706 
707  return ret;
708 }
709 
710 BOOL WINAPI
712 {
713  BOOL ret;
714 
716 
718 
719  return ret;
720 }
721 
722 INT WINAPI ClassicSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
723 {
725  {
726  return g_user32ApiHook.SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
727  }
728 
729  return SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
730 }
731 
732 INT WINAPI ClassicSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
733 {
735  {
736  return g_user32ApiHook.SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
737  }
738 
739  return SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
740 }
741 
743 {
745  {
746  return g_user32ApiHook.GetSystemMetrics(nIndex);
747  }
748 
749  return GetSystemMetrics(nIndex);
750 }
751 
752 BOOL WINAPI ClassicAdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
753 {
755  {
756  return g_user32ApiHook.AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
757  }
758 
759  return AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
760 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
HTHEME GetNCCaptionTheme(HWND hWnd, DWORD style)
Definition: themehooks.c:88
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HBRUSH hTabBackgroundBrush
Definition: uxthemep.h:160
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
#define TRUE
Definition: types.h:120
DWORD cbSize
Definition: winuser.h:3740
ULONG dwMajorVersion
Definition: rtltypes.h:234
BYTE gabDLGPmessages[UAHOWP_MAX_SIZE]
Definition: themehooks.c:14
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
INT SCROLL_TrackingVal
Definition: uxthemep.h:169
#define WM_CONTEXTMENU
Definition: richedit.h:64
HRESULT hr
Definition: shlfolder.c:183
#define UAH_HOOK_MESSAGE(uahowp, msg)
Definition: undocuser.h:324
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
OSVERSIONINFO osvi
Definition: ver.c:28
BOOL UpdatingRgn
Definition: uxthemep.h:158
LPCWSTR m_dllname2
Definition: undocuser.h:369
HINSTANCE hDllInst
Definition: system.c:45
void HackFillStaticBg(HWND hwnd, HDC hdc, HBRUSH *result)
Definition: themehooks.c:465
#define WM_MENUCHAR
Definition: winuser.h:1730
BOOL WINAPI ThemeHooksInstall()
Definition: themehooks.c:669
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
WNDPROC_OWP PostDefDlgProc
Definition: undocuser.h:343
UAHOWP DlgProcArray
Definition: undocuser.h:344
#define WM_CTLCOLORDLG
Definition: winuser.h:1752
DWORD dwStyle
Definition: winuser.h:3743
#define NULL_BRUSH
Definition: wingdi.h:900
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
static LRESULT CALLBACK ThemePostWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:384
BYTE gabDWPmessages[UAHOWP_MAX_SIZE]
Definition: themehooks.c:12
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:292
HANDLE HWND
Definition: compat.h:13
static HRGN hRgn
Definition: mapping.c:33
DWORD WINAPI GetThemeAppProperties(void)
Definition: system.c:933
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
UINT cyWindowBorders
Definition: winuser.h:3747
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define ZeroMemory
Definition: winbase.h:1642
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI ThemeHooksRemove()
Definition: themehooks.c:711
ATOM atWndContext
Definition: system.c:52
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define WM_NCHITTEST
Definition: winuser.h:1668
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd)
Definition: draw.c:56
LONG left
Definition: windef.h:291
#define WM_MDISETMENU
Definition: winuser.h:1804
HRESULT GetDiaogTextureBrush(HTHEME theme, HWND hwnd, HDC hdc, HBRUSH *result, BOOL changeOrigin)
Definition: themehooks.c:402
HBITMAP hTabBackgroundBmp
Definition: uxthemep.h:161
LONG right
Definition: windef.h:293
#define E_FAIL
Definition: ddrawi.h:102
#define BOOL
Definition: nt_native.h:43
#define WM_NCCREATE
Definition: winuser.h:1665
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
HTHEME hthemeScrollbar
Definition: uxthemep.h:152
#define WM_SETTINGCHANGE
Definition: winuser.h:1611
#define WM_PRINTCLIENT
Definition: richedit.h:70
BOOL HasAppDefinedRgn
Definition: uxthemep.h:156
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
void UXTHEME_LoadTheme(BOOL bLoad)
Definition: system.c:183
uint32_t ULONG_PTR
Definition: typedefs.h:63
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
#define WM_NCPAINT
Definition: winuser.h:1669
OSVERSIONINFOA OSVERSIONINFO
Definition: rtltypes.h:289
BOOL(CALLBACK * USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah)
Definition: undocuser.h:362
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1032
HINSTANCE hInstance
Definition: charmap.c:20
SETWINDOWRGN SetWindowRgn
Definition: undocuser.h:338
LPCWSTR m_funname1
Definition: undocuser.h:368
ADJUSTWINDOWRECTEX AdjustWindowRectEx
Definition: undocuser.h:337
#define WM_CTLCOLORBTN
Definition: winuser.h:1751
WNDPROC DefWindowProcW
Definition: undocuser.h:332
WNDPROC_OWP PostWndProc
Definition: undocuser.h:340
#define WM_NCACTIVATE
Definition: winuser.h:1670
INT WINAPI ClassicSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: themehooks.c:722
#define WS_MINIMIZE
Definition: pedump.c:622
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ClassicAdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
Definition: themehooks.c:752
BOOL WINAPI IsAppThemed(void)
Definition: system.c:596
#define GA_PARENT
Definition: winuser.h:2763
SYSTEMPARAMETERSINFOW SystemParametersInfoW
Definition: undocuser.h:347
UAHOWP DefWndProcArray
Definition: undocuser.h:333
#define TRANSPARENT
Definition: wingdi.h:949
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
#define RGN_OR
Definition: wingdi.h:358
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1748
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3568
#define WM_SETTEXT
Definition: winuser.h:1599
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:233
GETSCROLLINFO GetScrollInfo
Definition: undocuser.h:334
LPCWSTR m_dllname1
Definition: undocuser.h:367
HBITMAP hbmp
INT WINAPI ClassicGetSystemMetrics(int nIndex)
Definition: themehooks.c:742
#define WS_CAPTION
Definition: pedump.c:624
HBRUSH WINAPI CreatePatternBrush(_In_ HBITMAP)
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
BOOL(WINAPI * PREGISTER_UAH_WINXP)(HINSTANCE hInstance, USERAPIHOOKPROC CallbackFunc)
Definition: themehooks.c:665
GETSYSTEMMETRICS GetSystemMetrics
Definition: undocuser.h:345
DWORD dwExStyle
Definition: winuser.h:3744
INT SCROLL_TrackingBar
Definition: uxthemep.h:167
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
struct _WND_DATA * PWND_DATA
#define SM_CYCAPTION
Definition: winuser.h:953
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WM_SIZE
Definition: winuser.h:1593
LONG HRESULT
Definition: typedefs.h:77
HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:819
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:45
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define WM_NCDESTROY
Definition: winuser.h:1666
#define WINAPI
Definition: msvc.h:8
static BOOL CALLBACK ThemeCleanupChildWndContext(HWND hWnd, LPARAM msg)
Definition: themehooks.c:148
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC, _In_ LPARAM)
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
HTHEME GetNCScrollbarTheme(HWND hWnd, DWORD style)
Definition: themehooks.c:118
#define WM_MEASUREITEM
Definition: winuser.h:1628
DWORD Size
Definition: undocuser.h:321
Definition: id3.c:18
WNDPROC_OWP PreDefDlgProc
Definition: undocuser.h:342
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme)
Definition: nonclient.c:213
#define WS_HSCROLL
Definition: pedump.c:628
BOOL DirtyThemeRegion
Definition: uxthemep.h:159
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:851
WNDPROC DefWindowProcA
Definition: undocuser.h:331
void ThemeDestroyWndData(HWND hWnd)
Definition: themehooks.c:38
int ret
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
void SetThemeRegion(HWND hWnd)
Definition: themehooks.c:169
ULONG dwMinorVersion
Definition: rtltypes.h:235
unsigned char BYTE
Definition: mem.h:68
struct @1580 Msg[]
BOOL HasThemeRgn
Definition: uxthemep.h:157
LRESULT CALLBACK ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndProc)
Definition: nonclient.c:998
BYTE * MsgBitArray
Definition: undocuser.h:320
BOOL WINAPI UnregisterUserApiHook(VOID)
Definition: usrapihk.c:394
#define SWP_NOSIZE
Definition: winuser.h:1230
#define GWL_STYLE
Definition: winuser.h:846
BOOL(WINAPI * PREGISTER_UUAH_WIN2003)(PUSERAPIHOOKINFO puah)
Definition: themehooks.c:666
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static LRESULT CALLBACK ThemeDlgPreWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:477
HWND WINAPI GetParent(_In_ HWND)
INT WINAPI ClassicSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: themehooks.c:732
HTHEME hthemeWindow
Definition: uxthemep.h:151
static BOOL CALLBACK ThemeCleanupWndContext(HWND hWnd, LPARAM msg)
Definition: themehooks.c:154
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
int WINAPI ThemeSetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw)
Definition: themehooks.c:529
SYSTEMPARAMETERSINFOA SystemParametersInfoA
Definition: undocuser.h:346
BOOL CALLBACK UXTHEME_broadcast_theme_changed(HWND hWnd, LPARAM enable)
Definition: system.c:68
#define GetModuleHandle
Definition: winbase.h:3651
BOOL WINAPI DeleteDC(_In_ HDC)
#define UAHOWP_MAX_SIZE
Definition: undocuser.h:326
unsigned char dummy
Definition: maze.c:118
BOOL WINAPI ThemeGetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
Definition: themehooks.c:541
#define SIF_TRACKPOS
Definition: winuser.h:1223
static LRESULT CALLBACK ThemeDefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: themehooks.c:293
#define GetVersionEx
Definition: winbase.h:3676
WNDPROC_OWP PreWndProc
Definition: undocuser.h:339
unsigned int UINT
Definition: ndis.h:50
#define WS_VSCROLL
Definition: pedump.c:627
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
UAHOWP WndProcArray
Definition: undocuser.h:341
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HWND SCROLL_TrackingWin
Definition: uxthemep.h:166
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
DWORD * PDWORD
Definition: pedump.c:68
#define WC_STATICW
Definition: commctrl.h:4651
#define WM_DRAWITEM
Definition: winuser.h:1627
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define msg(x)
Definition: auth_time.c:54
#define WM_NCUAHDRAWFRAME
Definition: undocuser.h:46
#define WM_UAHINIT
Definition: undocuser.h:60
#define WM_CREATE
Definition: winuser.h:1590
BOOL CALLBACK ThemeInitApiHook(UAPIHK State, PUSERAPIHOOK puah)
Definition: themehooks.c:584
enum _UAPIHK UAPIHK
BOOL g_bThemeHooksActive
Definition: themehooks.c:15
#define UNIMPLEMENTED
Definition: debug.h:114
LONG bottom
Definition: windef.h:294
#define WM_NCMOUSELEAVE
Definition: winuser.h:1824
static LRESULT CALLBACK ThemeDlgPostWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:483
#define GetProcAddress(x, y)
Definition: compat.h:410
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static HBITMAP
Definition: button.c:44
PWND_DATA ThemeGetWndData(HWND hWnd)
Definition: themehooks.c:17
int OnPostWinPosChanged(HWND hWnd, WINDOWPOS *pWinPos)
Definition: themehooks.c:218
static LRESULT CALLBACK ThemePreWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ret, PDWORD unknown)
Definition: themehooks.c:317
LONG_PTR LRESULT
Definition: windef.h:209
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
Arabic default style
Definition: afstyles.h:93
USERAPIHOOK g_user32ApiHook
Definition: themehooks.c:11
GLuint64EXT * result
Definition: glext.h:11304
#define WM_SYSCOMMAND
Definition: winuser.h:1723
#define SM_CYSMCAPTION
Definition: winuser.h:1004
#define WM_INITDIALOG
Definition: winuser.h:1721
BYTE gabMSGPmessages[UAHOWP_MAX_SIZE]
Definition: themehooks.c:13
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SRCCOPY
Definition: wingdi.h:332
#define MAKEINTATOM(i)
Definition: winbase.h:1423
#define WM_NCMOUSEMOVE
Definition: winuser.h:1673
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158
static LRESULT CALLBACK ThemeDefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: themehooks.c:269
LPCWSTR m_funname2
Definition: undocuser.h:370
#define WS_MAXIMIZE
Definition: pedump.c:623