Index: dll/win32/uxtheme/msstyles.c =================================================================== --- dll/win32/uxtheme/msstyles.c (revision 56069) +++ dll/win32/uxtheme/msstyles.c (working copy) @@ -1000,11 +1000,12 @@ lstrcpynW(szClassName, start, sizeof(szClassName)/sizeof(szClassName[0])); cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName); } + /*Set the Error in case pszClassList doesn't contain a valid Class */ if(cls) { TRACE("Opened app %s, class %s from list %s\n", debugstr_w(cls->szAppName), debugstr_w(cls->szClassName), debugstr_w(pszClassList)); cls->tf = tfActiveTheme; cls->tf->dwRefCount++; - } + } else SetLastError(E_PROP_ID_UNSUPPORTED); return cls; } Index: dll/win32/uxtheme/system.c =================================================================== --- dll/win32/uxtheme/system.c (revision 56069) +++ dll/win32/uxtheme/system.c (working copy) @@ -633,7 +633,7 @@ if(pszClassList == NULL) SetLastError(E_POINTER); - + if(bThemeActive) { pszAppName = UXTHEME_GetWindowProperty(hwnd, atSubAppName, szAppBuff, sizeof(szAppBuff)/sizeof(szAppBuff[0])); @@ -645,8 +645,10 @@ if (pszUseClassList) hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList); } + /*In case hwnd is not valid, set the Error */ if(IsWindow(hwnd)) SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme); + else SetLastError(E_PROP_ID_UNSUPPORTED); TRACE(" = %p\n", hTheme); return hTheme;