Author: gadamopoulos
Date: Fri Feb 24 22:47:59 2017
New Revision: 73897

URL: http://svn.reactos.org/svn/reactos?rev=73897&view=rev
Log:
[COMCTL32] -Draw button with classic style if BM_SETIMAGE was used.

Modified:
    trunk/reactos/dll/win32/comctl32/theme_button.c

Modified: trunk/reactos/dll/win32/comctl32/theme_button.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/theme_button.c?rev=73897&r1=73896&r2=73897&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/theme_button.c     [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/theme_button.c     [iso-8859-1] Fri Feb 24 
22:47:59 2017
@@ -38,6 +38,7 @@
 
 #define STATE_GWL_OFFSET  0
 #define HFONT_GWL_OFFSET  (sizeof(LONG))
+#define HIMAGE_GWL_OFFSET (HFONT_GWL_OFFSET+sizeof(HFONT))
 
 static inline LONG get_button_state( HWND hwnd )
 {
@@ -320,14 +321,24 @@
 
 BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM 
prfFlag)
 {
-    DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
-    DWORD dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE);
-    UINT dtFlags = get_drawtext_flags(dwStyle, dwStyleEx);
-    int state = get_button_state(hwnd);
+    DWORD dwStyle;
+    DWORD dwStyleEx;
+    UINT dtFlags;
+    int state;
     ButtonState drawState;
-    pfThemedPaint paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ];
+    pfThemedPaint paint;
+
+    dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
+    paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ];
     if (!paint)
         return FALSE;
+
+    if (GetWindowLongPtrW( hwnd, HIMAGE_GWL_OFFSET) != 0)
+        return FALSE;
+
+    dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE);
+    dtFlags = get_drawtext_flags(dwStyle, dwStyleEx);
+    state = get_button_state(hwnd);
 
     if(IsWindowEnabled(hwnd))
     {


Reply via email to