diff --git a/dll/win32/uxtheme/ncthm.h b/dll/win32/uxtheme/ncthm.h index 4b199ee595a..579ab50d54b 100644 --- a/dll/win32/uxtheme/ncthm.h +++ b/dll/win32/uxtheme/ncthm.h @@ -4,6 +4,7 @@ typedef struct _DRAW_CONTEXT HWND hWnd; HDC hDC; HTHEME theme; + HTHEME hPrevTheme; WINDOWINFO wi; BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */ HRGN hRgn; diff --git a/dll/win32/uxtheme/nonclient.c b/dll/win32/uxtheme/nonclient.c index 5577734eb8e..18b7c7418ff 100644 --- a/dll/win32/uxtheme/nonclient.c +++ b/dll/win32/uxtheme/nonclient.c @@ -165,6 +165,7 @@ ThemeInitDrawContext(PDRAW_CONTEXT pcontext, GetWindowInfo(hWnd, &pcontext->wi); pcontext->hWnd = hWnd; pcontext->Active = IsWindowActive(hWnd, pcontext->wi.dwExStyle); + pcontext->hPrevTheme = GetPropW(hWnd, (LPCWSTR)MAKEINTATOM(atWindowTheme)); pcontext->theme = OpenThemeData(pcontext->hWnd, L"WINDOW"); pcontext->CaptionHeight = pcontext->wi.cyWindowBorders; @@ -186,6 +187,8 @@ ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext) CloseThemeData (pcontext->theme); + SetPropW(pcontext->hWnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), pcontext->hPrevTheme); + if(pcontext->hRgn != NULL) { DeleteObject(pcontext->hRgn); diff --git a/dll/win32/uxtheme/system.c b/dll/win32/uxtheme/system.c index de805fce0b0..528bde41124 100644 --- a/dll/win32/uxtheme/system.c +++ b/dll/win32/uxtheme/system.c @@ -61,7 +61,7 @@ HINSTANCE hDllInst; ATOM atDialogThemeEnabled; static DWORD dwThemeAppProperties = STAP_ALLOW_NONCLIENT | STAP_ALLOW_CONTROLS; -static ATOM atWindowTheme; +ATOM atWindowTheme; static ATOM atSubAppName; static ATOM atSubIdList;