Author: gadamopoulos
Date: Wed Aug 9 08:14:50 2017
New Revision: 75514
URL:
http://svn.reactos.org/svn/reactos?rev=75514&view=rev
Log:
[UXTHEME] -Implement taking into account the flags set by SetThemeAppProperties. Now the
shim that disables themes per application works.
Modified:
trunk/reactos/dll/win32/uxtheme/system.c
trunk/reactos/dll/win32/uxtheme/themehooks.c
Modified: trunk/reactos/dll/win32/uxtheme/system.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/system.c…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] Wed Aug 9 08:14:50 2017
@@ -747,6 +747,18 @@
return NULL;
}
+ if ((flags & OTD_NONCLIENT) && !(dwThemeAppProperties &
STAP_ALLOW_NONCLIENT))
+ {
+ SetLastError(E_PROP_ID_UNSUPPORTED);
+ return NULL;
+ }
+
+ if (!(flags & OTD_NONCLIENT) && !(dwThemeAppProperties &
STAP_ALLOW_CONTROLS))
+ {
+ SetLastError(E_PROP_ID_UNSUPPORTED);
+ return NULL;
+ }
+
if (ThemeFile)
{
pszAppName = UXTHEME_GetWindowProperty(hwnd, atSubAppName, szAppBuff,
sizeof(szAppBuff)/sizeof(szAppBuff[0]));
Modified: trunk/reactos/dll/win32/uxtheme/themehooks.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/themehoo…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/themehooks.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/themehooks.c [iso-8859-1] Wed Aug 9 08:14:50 2017
@@ -98,6 +98,16 @@
if (pwndData == NULL)
return NULL;
+ if (!(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
+ {
+ if (pwndData->hthemeWindow)
+ {
+ CloseThemeData(pwndData->hthemeWindow);
+ pwndData->hthemeWindow = NULL;
+ }
+ return NULL;
+ }
+
/* If the theme data was not cached, open it now */
if (!pwndData->hthemeWindow)
pwndData->hthemeWindow = OpenThemeDataEx(hWnd, L"WINDOW",
OTD_NONCLIENT);
@@ -117,6 +127,16 @@
pwndData = ThemeGetWndData(hWnd);
if (pwndData == NULL)
return NULL;
+
+ if (!(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
+ {
+ if (pwndData->hthemeScrollbar)
+ {
+ CloseThemeData(pwndData->hthemeScrollbar);
+ pwndData->hthemeScrollbar = NULL;
+ }
+ return NULL;
+ }
/* If the theme data was not cached, open it now */
if (!pwndData->hthemeScrollbar)
@@ -222,7 +242,7 @@
if (pwndData->UpdatingRgn == TRUE)
return 0;
- if(!IsAppThemed())
+ if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
{
if(pwndData->HasThemeRgn)
{
@@ -248,7 +268,7 @@
static LRESULT CALLBACK
ThemeDefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
- if(!IsAppThemed())
+ if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
{
return g_user32ApiHook.DefWindowProcW(hWnd,
Msg,
@@ -266,7 +286,7 @@
static LRESULT CALLBACK
ThemeDefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
- if(!IsAppThemed())
+ if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
{
return g_user32ApiHook.DefWindowProcA(hWnd,
Msg,
@@ -456,7 +476,7 @@
HBRUSH* phbrush = (HBRUSH*)ret;
HTHEME hTheme;
- if (!IsAppThemed())
+ if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
break;
if (!IsThemeDialogTextureEnabled (hWnd))
@@ -507,7 +527,7 @@
BOOL ret;
/* Avoid creating a window context if it is not needed */
- if(!IsAppThemed())
+ if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT))
goto dodefault;
style = GetWindowLongW(hwnd, GWL_STYLE);