Index: dll/win32/comctl32/toolbar.c
===================================================================
--- dll/win32/comctl32/toolbar.c	(revision 67577)
+++ dll/win32/comctl32/toolbar.c	(working copy)
@@ -611,7 +611,57 @@
     }
 }
 
+/*
+ * Draw the text string with theme for this button.
+ * note: infoPtr->himlDis *SHOULD* be non-zero when infoPtr->himlDef
+ * 	is non-zero, so we can simply check himlDef to see if we have
+ *      an image list
+ */
+static void
+TOOLBAR_DrawThemeString (HTHEME theme, const TOOLBAR_INFO *infoPtr, RECT *rcText, LPCWSTR lpText,
+                    const NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag)
+{
+    HDC hdc = tbcd->nmcd.hdc;
+    UINT state = tbcd->nmcd.uItemState;
+    INT iStateId;
+    /* draw text */
+    if (lpText && infoPtr->nMaxTextRows > 0){
+        TRACE("string=%s rect=(%s)\n", debugstr_w(lpText),
+              wine_dbgstr_rect(rcText));
+    }
 
+  /* Fixme! what about CDIS_FOCUS CDIS_SHOWKEYBOARDCUES CDIS_DROPHILITED CDIS_INDETERMINATE */
+  iStateId = TS_NORMAL;
+	if (dwItemCDFlag & TBCDRF_HILITEHOTTRACK)
+  {
+      if (state & CDIS_HOT)
+      {
+          if (state & CDIS_CHECKED)
+              iStateId = TS_HOTCHECKED;
+          else
+              iStateId = TS_HOT;
+      }
+     /* else if (state & CDIS_NEARHOT)
+          iStateId = TS_NEARHOT;
+      else if (state & CDIS_OTHERSIDEHOT) 
+          iStateId = TS_OTHERSIDEHOT;
+      */
+  }
+  if ((state & CDIS_CHECKED) && !(state & CDIS_HOT) )
+      iStateId = TS_CHECKED;
+  else if (state & (CDIS_DISABLED | CDIS_GRAYED))
+      iStateId = TS_DISABLED;
+  else if (state & CDIS_SELECTED) 
+      iStateId = TS_PRESSED;
+  else if ((state & CDIS_MARKED) && !(dwItemCDFlag & TBCDRF_NOMARK))
+      iStateId = TS_HOT;
+  
+  DrawThemeText(theme, hdc, TP_BUTTON, iStateId, lpText, -1, infoPtr->dwDTFlags, 0, rcText);
+}
+
+
+
+
 static void
 TOOLBAR_DrawPattern (const RECT *lpRect, const NMTBCUSTOMDRAW *tbcd)
 {
@@ -873,6 +923,7 @@
     DWORD dwItemCustDraw;
     DWORD dwItemCDFlag;
     HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
+    HFONT hOldFont;
 
     rc = btnPtr->rect;
     CopyRect (&rcArrow, &rc);
@@ -1094,9 +1145,16 @@
     }
 
     oldBkMode = SetBkMode (hdc, tbcd.nStringBkMode);
+    hOldFont = SelectObject (hdc, infoPtr->hFont);
     if (!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_SHOWTEXT))
-        TOOLBAR_DrawString (infoPtr, &rcText, lpText, &tbcd, dwItemCDFlag);
+    {
+        if (theme && !(infoPtr->dwStyle & CCS_VERT))
+            TOOLBAR_DrawThemeString(theme, infoPtr, &rcText, lpText, &tbcd, dwItemCDFlag);
+        else
+            TOOLBAR_DrawString (infoPtr, &rcText, lpText, &tbcd, dwItemCDFlag);
+    }
     SetBkMode (hdc, oldBkMode);
+    SelectObject (hdc, hOldFont);
 
     TOOLBAR_DrawImage(infoPtr, btnPtr, rcBitmap.left, rcBitmap.top, &tbcd, dwItemCDFlag);
 
@@ -1224,6 +1282,7 @@
 		      HDC hdc, LPSIZE lpSize)
 {
     RECT myrect;
+    HTHEME theme = GetWindowTheme(infoPtr->hwndSelf);
 
     lpSize->cx = 0;
     lpSize->cy = 0;
@@ -1236,22 +1295,34 @@
         LPWSTR lpText = TOOLBAR_GetText(infoPtr, btnPtr);
 
 	if(lpText != NULL) {
-	    /* first get size of all the text */
-	    GetTextExtentPoint32W (hdc, lpText, strlenW (lpText), lpSize);
+            /* use theme measuring */
+            if (theme)
+            {
+            GetThemeTextExtent(theme, hdc, TP_BUTTON,
+                                  TS_NORMAL, lpText, strlenW (lpText),
+                                  DT_SINGLELINE |
+                                  DT_CALCRECT | ((btnPtr->fsStyle & BTNS_NOPREFIX) ?
+                                  DT_NOPREFIX : 0), NULL,
+                                  &myrect);
+            }
+            else
+            {
+	        /* first get size of all the text */
+	        GetTextExtentPoint32W (hdc, lpText, strlenW (lpText), lpSize);
 
-	    /* feed above size into the rectangle for DrawText */
-	    myrect.left = myrect.top = 0;
-	    myrect.right = lpSize->cx;
-	    myrect.bottom = lpSize->cy;
+	        /* feed above size into the rectangle for DrawText */
+	        myrect.left = myrect.top = 0;
+	        myrect.right = lpSize->cx;
+	        myrect.bottom = lpSize->cy;
 
-	    /* Use DrawText to get true size as drawn (less pesky "&") */
-	    DrawTextW (hdc, lpText, -1, &myrect, DT_VCENTER | DT_SINGLELINE |
-	    	   DT_CALCRECT | ((btnPtr->fsStyle & BTNS_NOPREFIX) ?
+	        /* Use DrawText to get true size as drawn (less pesky "&") */
+	        DrawTextW (hdc, lpText, -1, &myrect, DT_VCENTER | DT_SINGLELINE |
+	        	   DT_CALCRECT | ((btnPtr->fsStyle & BTNS_NOPREFIX) ?
 				  DT_NOPREFIX : 0));
-
-	    /* feed back to caller  */
-	    lpSize->cx = myrect.right;
-	    lpSize->cy = myrect.bottom;
+            }
+            /* feed back to caller  */
+            lpSize->cx = myrect.right;
+            lpSize->cy = myrect.bottom;
 	}
     }
 
