[1/2] uxtheme: Add OpenThemeDataEx (try 2)

André Hentschel nerv at dawncrow.de
Wed Mar 23 11:51:57 CDT 2011


Applied Dmitry's suggestions
---
 dlls/uxtheme/system.c     |   37 ++++++++++++++++++++++++-------------
 dlls/uxtheme/uxtheme.spec |    2 +-
 include/uxtheme.h         |    5 +++++
 3 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index b84e978..4dc9188 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -630,27 +630,30 @@ static LPWSTR UXTHEME_GetWindowProperty(HWND hwnd, ATOM aProp, LPWSTR pszBuffer,
 }
 
 /***********************************************************************
- *      OpenThemeData                                       (UXTHEME.@)
+ *      OpenThemeDataEx                                     (UXTHEME.@)
  */
-HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
+HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR classlist, DWORD flags)
 {
-    WCHAR szAppBuff[256];
-    WCHAR szClassBuff[256];
-    LPCWSTR pszAppName;
-    LPCWSTR pszUseClassList;
+    WCHAR appbuff[256];
+    WCHAR classbuff[256];
+    LPCWSTR appname;
+    LPCWSTR useclasslist;
     HTHEME hTheme = NULL;
-    TRACE("(%p,%s)\n", hwnd, debugstr_w(pszClassList));
+    TRACE("(%p,%s, %u)\n", hwnd, debugstr_w(classlist), flags);
+
+    if(flags)
+        FIXME("unhandled Flags: %x\n", flags);
 
     if(bThemeActive)
     {
-        pszAppName = UXTHEME_GetWindowProperty(hwnd, atSubAppName, szAppBuff, sizeof(szAppBuff)/sizeof(szAppBuff[0]));
+        appname = UXTHEME_GetWindowProperty(hwnd, atSubAppName, appbuff, sizeof(appbuff)/sizeof(appbuff[0]));
         /* If SetWindowTheme was used on the window, that overrides the class list passed to this function */
-        pszUseClassList = UXTHEME_GetWindowProperty(hwnd, atSubIdList, szClassBuff, sizeof(szClassBuff)/sizeof(szClassBuff[0]));
-        if(!pszUseClassList)
-            pszUseClassList = pszClassList;
+        useclasslist = UXTHEME_GetWindowProperty(hwnd, atSubIdList, classbuff, sizeof(classbuff)/sizeof(classbuff[0]));
+        if(!useclasslist)
+            useclasslist = classlist;
 
-        if (pszUseClassList)
-            hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList);
+        if (useclasslist)
+            hTheme = MSSTYLES_OpenThemeClass(appname, useclasslist);
     }
     if(IsWindow(hwnd))
         SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme);
@@ -659,6 +662,14 @@ HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
 }
 
 /***********************************************************************
+ *      OpenThemeData                                       (UXTHEME.@)
+ */
+HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
+{
+    return OpenThemeDataEx(hwnd, classlist, 0);
+}
+
+/***********************************************************************
  *      GetWindowTheme                                      (UXTHEME.@)
  *
  * Retrieve the last theme opened for a window.
diff --git a/dlls/uxtheme/uxtheme.spec b/dlls/uxtheme/uxtheme.spec
index f44aa6e..198957a 100644
--- a/dlls/uxtheme/uxtheme.spec
+++ b/dlls/uxtheme/uxtheme.spec
@@ -38,7 +38,7 @@
 46 stub -noname ClassicAdjustWindowRectEx
 48 stub -noname GetThemeParseErrorInfo
 60 stub -noname CreateThemeDataFromObjects
-61 stub -noname OpenThemeDataEx
+61 stdcall OpenThemeDataEx(ptr wstr long)
 62 stub -noname ServerClearStockObjects
 63 stub -noname MarkSelection
 
diff --git a/include/uxtheme.h b/include/uxtheme.h
index ef369dc..8e65f56 100644
--- a/include/uxtheme.h
+++ b/include/uxtheme.h
@@ -160,6 +160,10 @@ HTHEME WINAPI GetWindowTheme(HWND);
 #define HTTB_SIZINGTEMPLATE         0x0100
 #define HTTB_SYSTEMSIZINGMARGINS    0x0200
 
+#define OTD_FORCE_RECT_SIZING       0x0001
+#define OTD_NONCLIENT               0x0002
+#define OTD_VALIDBITS               (OTD_FORCE_RECT_SIZING | OTD_NONCLIENT)
+
 HRESULT WINAPI HitTestThemeBackground(HTHEME,HDC,int,int,DWORD,const RECT*,
                                       HRGN,POINT,WORD*);
 BOOL WINAPI IsAppThemed(void);
@@ -168,6 +172,7 @@ BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME,int,int);
 BOOL WINAPI IsThemeDialogTextureEnabled(HWND);
 BOOL WINAPI IsThemePartDefined(HTHEME,int,int);
 HTHEME WINAPI OpenThemeData(HWND,LPCWSTR);
+HTHEME WINAPI OpenThemeDataEx(HWND,LPCWSTR,DWORD);
 void WINAPI SetThemeAppProperties(DWORD);
 HRESULT WINAPI SetWindowTheme(HWND,LPCWSTR,LPCWSTR);
 
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list