Index: trunk/src/comctl32/resource.asm
===================================================================
--- trunk/src/comctl32/resource.asm	(revision 2163)
+++ trunk/src/comctl32/resource.asm	(revision 2164)
@@ -1,6 +1,6 @@
 ;/* This file is generated with wrc version 1.0.14 (08-Aug-1999). Do not edit! */
 ;/* Source : rsrc.rc */
-;/* Cmdline: wrc -s -I. -IH:\IBMCPP3\include -I..\..\include -I..\..\include\win -o resource.asm rsrc.rc */
-;/* Date   : Sat Dec 18 21:17:00 1999 */
+;/* Cmdline: wrc -s -I. -IE:\IBMCPP\include -I..\..\include -I..\..\include\win -o resource.asm rsrc.rc */
+;/* Date   : Sun Dec 19 18:42:30 1999 */
 
 	.386p
@@ -12,5 +12,5 @@
 	public	_Resource_PEResTab
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 5
@@ -27,5 +27,5 @@
 L2:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 7
@@ -46,5 +46,5 @@
 L4:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -53,5 +53,5 @@
 L5:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 3
@@ -64,5 +64,5 @@
 L6:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -71,5 +71,5 @@
 L16:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -78,5 +78,5 @@
 L2_120:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -85,5 +85,5 @@
 L2_121:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -92,5 +92,5 @@
 L2_124:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -99,5 +99,5 @@
 L2_125:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -106,5 +106,5 @@
 L2_130:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -113,5 +113,5 @@
 L2_131:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -120,5 +120,5 @@
 L2_401:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -127,5 +127,5 @@
 L4_300:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -134,5 +134,5 @@
 L5_200:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -141,5 +141,5 @@
 L5_1006:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -148,5 +148,5 @@
 L5_1020:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -155,5 +155,5 @@
 L6_261:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
@@ -162,5 +162,5 @@
 L16_1:
 	dd	0
-	dd	0385bebbch
+	dd	0385d1906h
 	dd	0
 	dw	0, 1
Index: trunk/src/comctl32/toolbar.c
===================================================================
--- trunk/src/comctl32/toolbar.c	(revision 2163)
+++ trunk/src/comctl32/toolbar.c	(revision 2164)
@@ -1,3 +1,3 @@
-/* $Id: toolbar.c,v 1.21 1999-12-20 18:22:28 achimha Exp $ */
+/* $Id: toolbar.c,v 1.22 1999-12-20 18:44:08 cbratschi Exp $ */
 /*
  * Toolbar control
@@ -1518,5 +1518,5 @@
 
     /* draw text */
-    if (btnPtr == NULL)
+    if (!btnPtr || btnPtr->fsStyle & TBSTYLE_SEP)
     { //new separator
       DrawTextA(lpdis->hDC,"Separator",-1,&rcText,DT_LEFT | DT_VCENTER | DT_SINGLELINE);
@@ -1613,153 +1613,153 @@
     switch (uMsg)
     {
-	case WM_INITDIALOG:
-	    infoPtr = (TOOLBAR_INFO *)lParam;
-	    SetWindowLongA (hwnd, DWL_USER, (DWORD)infoPtr);
-
-	    hDsa = DSA_Create (sizeof(TBUTTON_INFO), 5);
-
-	    if (infoPtr)
-	    {
-		TBUTTON_INFO *btnPtr;
-		INT i;
-
-		/* insert 'virtual' separator button into 'available buttons' list */
-		SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
-
-		/* copy all buttons and append them to the right listbox */		
-		btnPtr = infoPtr->buttons;
-		for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)
-		{
-		    DSA_InsertItem (hDsa, i, btnPtr);
-
-		    /* FIXME: hidden buttons appear in the 'toolbar buttons' list too */
-		    if (btnPtr->fsState & TBSTATE_HIDDEN)
-		    {
-			SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
-		    }
-		    else
-		    {
-			SendDlgItemMessageA (hwnd, IDC_TOOLBARBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
-		    }
-		}
-
-		/* append 'virtual' separator button to the 'toolbar buttons' list */
-		/* TODO */
-	    }
-	    return TRUE;
-
-	case WM_CLOSE:
-	    EndDialog(hwnd, FALSE);
-	    return TRUE;
-
-	case WM_COMMAND:
-	    switch (LOWORD(wParam))
-	    {
-		case IDCANCEL:
-		    EndDialog(hwnd, FALSE);
-		    break;
-	    }
-	    return TRUE;
-
-	case WM_DESTROY:
-	    if (hDsa)
-		DSA_Destroy (hDsa);
-	    return TRUE;
-
-	case WM_DRAWITEM:
-	    if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)
-	    {
-		LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
-		TBUTTON_INFO btnPtr;
-		RECT rcButton;
-		RECT rcText;
-		HPEN hOldPen;
-		HBRUSH hOldBrush;
-		COLORREF oldText = 0;
-		COLORREF oldBk = 0;
-
-		FIXME("action: %x itemState: %x\n",
-		      lpdis->itemAction, lpdis->itemState);		
-
-		DSA_GetItem (hDsa, 0 /*lpdis->itemID*/, &btnPtr);
-
-		if (lpdis->itemState & ODS_FOCUS)
-		{
-		    oldBk = SetBkColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT));
-		    oldText = SetTextColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
-		}
-
-		hOldPen = SelectObject (lpdis->hDC, GetSysColorPen ((lpdis->itemState & ODS_SELECTED)?COLOR_HIGHLIGHT:COLOR_WINDOW));
-		hOldBrush = SelectObject (lpdis->hDC, GetSysColorBrush ((lpdis->itemState & ODS_FOCUS)?COLOR_HIGHLIGHT:COLOR_WINDOW));
-
-		/* fill background rectangle */
-		Rectangle (lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top,
-			   lpdis->rcItem.right, lpdis->rcItem.bottom);
-
-		/* calculate button and text rectangles */
-		CopyRect (&rcButton, &lpdis->rcItem);
-		InflateRect (&rcButton, -1, -1);
-		CopyRect (&rcText, &rcButton);
-		rcButton.right = rcButton.left + infoPtr->nBitmapWidth + 6;
-		rcText.left = rcButton.right + 2;
-
-		/* draw focus rectangle */
-		if (lpdis->itemState & ODS_FOCUS)
-		    DrawFocusRect (lpdis->hDC, &lpdis->rcItem);
-
-		/* draw button */
-		DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);
-
-		/* draw image and text */
-		if (wParam == IDC_AVAILBTN_LBOX && lpdis->itemID == 0)
-		{
-		    /* virtual separator in the 'available' list */
-		    DrawTextA (lpdis->hDC, "Separator", -1, &rcText,
-			       DT_LEFT | DT_VCENTER | DT_SINGLELINE);
-		}
-		else
-		{
-		    /* real button */
-
-		    ImageList_Draw (infoPtr->himlDef, btnPtr.iBitmap, lpdis->hDC,
-				    rcButton.left+1, rcButton.top+1, ILD_NORMAL);
+        case WM_INITDIALOG:
+            infoPtr = (TOOLBAR_INFO *)lParam;
+            SetWindowLongA (hwnd, DWL_USER, (DWORD)infoPtr);
+
+            hDsa = DSA_Create (sizeof(TBUTTON_INFO), 5);
+
+            if (infoPtr)
+            {
+                TBUTTON_INFO *btnPtr;
+                INT i;
+
+                /* insert 'virtual' separator button into 'available buttons' list */
+                SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
+
+                /* copy all buttons and append them to the right listbox */
+                btnPtr = infoPtr->buttons;
+                for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)
+                {
+                    DSA_InsertItem (hDsa, i, btnPtr);
+
+                    /* FIXME: hidden buttons appear in the 'toolbar buttons' list too */
+                    if (btnPtr->fsState & TBSTATE_HIDDEN)
+                    {
+                        SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
+                    }
+                    else
+                    {
+                        SendDlgItemMessageA (hwnd, IDC_TOOLBARBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
+                    }
+                }
+
+                /* append 'virtual' separator button to the 'toolbar buttons' list */
+                /* TODO */
+            }
+            return TRUE;
+
+        case WM_CLOSE:
+            EndDialog(hwnd, FALSE);
+            return TRUE;
+
+        case WM_COMMAND:
+            switch (LOWORD(wParam))
+            {
+                case IDCANCEL:
+                    EndDialog(hwnd, FALSE);
+                    break;
+            }
+            return TRUE;
+
+        case WM_DESTROY:
+            if (hDsa)
+                DSA_Destroy (hDsa);
+            return TRUE;
+
+        case WM_DRAWITEM:
+            if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)
+            {
+                LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
+                TBUTTON_INFO btnPtr;
+                RECT rcButton;
+                RECT rcText;
+                HPEN hOldPen;
+                HBRUSH hOldBrush;
+                COLORREF oldText = 0;
+                COLORREF oldBk = 0;
+
+                FIXME("action: %x itemState: %x\n",
+                      lpdis->itemAction, lpdis->itemState);
+
+                DSA_GetItem (hDsa, 0 /*lpdis->itemID*/, &btnPtr);
+
+                if (lpdis->itemState & ODS_FOCUS)
+                {
+                    oldBk = SetBkColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT));
+                    oldText = SetTextColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
+                }
+
+                hOldPen = SelectObject (lpdis->hDC, GetSysColorPen ((lpdis->itemState & ODS_SELECTED)?COLOR_HIGHLIGHT:COLOR_WINDOW));
+                hOldBrush = SelectObject (lpdis->hDC, GetSysColorBrush ((lpdis->itemState & ODS_FOCUS)?COLOR_HIGHLIGHT:COLOR_WINDOW));
+
+                /* fill background rectangle */
+                Rectangle (lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top,
+                           lpdis->rcItem.right, lpdis->rcItem.bottom);
+
+                /* calculate button and text rectangles */
+                CopyRect (&rcButton, &lpdis->rcItem);
+                InflateRect (&rcButton, -1, -1);
+                CopyRect (&rcText, &rcButton);
+                rcButton.right = rcButton.left + infoPtr->nBitmapWidth + 6;
+                rcText.left = rcButton.right + 2;
+
+                /* draw focus rectangle */
+                if (lpdis->itemState & ODS_FOCUS)
+                    DrawFocusRect (lpdis->hDC, &lpdis->rcItem);
+
+                /* draw button */
+                DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);
+
+                /* draw image and text */
+                if (wParam == IDC_AVAILBTN_LBOX && lpdis->itemID == 0)
+                {
+                    /* virtual separator in the 'available' list */
+                    DrawTextA (lpdis->hDC, "Separator", -1, &rcText,
+                               DT_LEFT | DT_VCENTER | DT_SINGLELINE);
+                }
+                else
+                {
+                    /* real button */
+
+                    ImageList_Draw (infoPtr->himlDef, btnPtr.iBitmap, lpdis->hDC,
+                                    rcButton.left+1, rcButton.top+1, ILD_NORMAL);
 //AH: TODO: Find out why this happens!!!
 if ((infoPtr->strings == NULL) || (infoPtr->strings[btnPtr.iString] == NULL))
   dprintf(("COMCTL32:TOOLBAR:CustomizeDialog - Error drawing string - pointer not found!\n"));
 else
-		    DrawTextW (lpdis->hDC,  infoPtr->strings[btnPtr.iString], -1, &rcText,
-			       DT_LEFT | DT_VCENTER | DT_SINGLELINE);
-
-		}
-
-		if (lpdis->itemState & ODS_FOCUS)
-		{
-		    SetBkColor (lpdis->hDC, oldBk);
-		    SetTextColor (lpdis->hDC, oldText);
-		}
-
-		SelectObject (lpdis->hDC, hOldBrush);
-		SelectObject (lpdis->hDC, hOldPen);
-
-		return TRUE;
-	    }
-	    return FALSE;
-
-	case WM_MEASUREITEM:
-	    if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)
-	    {
-		MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*)lParam;
-
-		if (infoPtr)
-		    lpmis->itemHeight = infoPtr->nBitmapHeight + 8;
-		else
-		    lpmis->itemHeight = 16 + 8; /* default height */
-
-		return TRUE;
-	    }
-	    return FALSE;
-
-	default:
-	    return FALSE;
+                    DrawTextW (lpdis->hDC,  infoPtr->strings[btnPtr.iString], -1, &rcText,
+                               DT_LEFT | DT_VCENTER | DT_SINGLELINE);
+
+                }
+
+                if (lpdis->itemState & ODS_FOCUS)
+                {
+                    SetBkColor (lpdis->hDC, oldBk);
+                    SetTextColor (lpdis->hDC, oldText);
+                }
+
+                SelectObject (lpdis->hDC, hOldBrush);
+                SelectObject (lpdis->hDC, hOldPen);
+
+                return TRUE;
+            }
+            return FALSE;
+
+        case WM_MEASUREITEM:
+            if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)
+            {
+                MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*)lParam;
+
+                if (infoPtr)
+                    lpmis->itemHeight = infoPtr->nBitmapHeight + 8;
+                else
+                    lpmis->itemHeight = 16 + 8; /* default height */
+
+                return TRUE;
+            }
+            return FALSE;
+
+        default:
+            return FALSE;
     }
 }
@@ -1984,5 +1984,5 @@
     INT nOldButtons, nNewButtons, nAddButtons, nCount;
 
-    TRACE("adding %d buttons!\n", wParam);
+//    TRACE("adding %d buttons!\n", wParam);
 
     nAddButtons = (UINT)wParam;
@@ -1991,13 +1991,13 @@
 
     if (infoPtr->nNumButtons == 0) {
-	infoPtr->buttons =
-	    COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);
+        infoPtr->buttons =
+            COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);
     }
     else {
-	TBUTTON_INFO *oldButtons = infoPtr->buttons;
-	infoPtr->buttons =
-	    COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);
-	memcpy (&infoPtr->buttons[0], &oldButtons[0],
-		nOldButtons * sizeof(TBUTTON_INFO));
+        TBUTTON_INFO *oldButtons = infoPtr->buttons;
+        infoPtr->buttons =
+            COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);
+        memcpy (&infoPtr->buttons[0], &oldButtons[0],
+                nOldButtons * sizeof(TBUTTON_INFO));
         COMCTL32_Free (oldButtons);
     }
@@ -2007,26 +2007,26 @@
     /* insert new button data */
     for (nCount = 0; nCount < nAddButtons; nCount++) {
-	TBUTTON_INFO *btnPtr = &infoPtr->buttons[nOldButtons+nCount];
-	btnPtr->iBitmap   = lpTbb[nCount].iBitmap;
-	btnPtr->idCommand = lpTbb[nCount].idCommand;
-	btnPtr->fsState   = lpTbb[nCount].fsState;
-	btnPtr->fsStyle   = lpTbb[nCount].fsStyle;
-	btnPtr->dwData    = lpTbb[nCount].dwData;
-	btnPtr->iString   = lpTbb[nCount].iString;
-	btnPtr->bHot      = FALSE;
-
-	if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & TBSTYLE_SEP)) {
-	    TTTOOLINFOW ti;
-
-	    ZeroMemory (&ti, sizeof(TTTOOLINFOW));
-	    ti.cbSize   = sizeof (TTTOOLINFOW);
-	    ti.hwnd     = hwnd;
-	    ti.uId      = btnPtr->idCommand;
-	    ti.hinst    = 0;
-	    ti.lpszText = LPSTR_TEXTCALLBACKW;
-
-	    SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW,
-			    0, (LPARAM)&ti);
-	}
+        TBUTTON_INFO *btnPtr = &infoPtr->buttons[nOldButtons+nCount];
+        btnPtr->iBitmap   = lpTbb[nCount].iBitmap;
+        btnPtr->idCommand = lpTbb[nCount].idCommand;
+        btnPtr->fsState   = lpTbb[nCount].fsState;
+        btnPtr->fsStyle   = lpTbb[nCount].fsStyle;
+        btnPtr->dwData    = lpTbb[nCount].dwData;
+        btnPtr->iString   = lpTbb[nCount].iString;
+        btnPtr->bHot      = FALSE;
+
+        if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & TBSTYLE_SEP)) {
+            TTTOOLINFOW ti;
+
+            ZeroMemory (&ti, sizeof(TTTOOLINFOW));
+            ti.cbSize   = sizeof (TTTOOLINFOW);
+            ti.hwnd     = hwnd;
+            ti.uId      = btnPtr->idCommand;
+            ti.hinst    = 0;
+            ti.lpszText = LPSTR_TEXTCALLBACKW;
+
+            SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW,
+                            0, (LPARAM)&ti);
+        }
     }
 
@@ -2690,8 +2690,8 @@
 
     if (!(GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT))
-	return -1;
+        return -1;
 
     if (infoPtr->nHotItem < 0)
-	return -1;
+        return -1;
 
     return (LRESULT)infoPtr->nHotItem;
@@ -2945,12 +2945,12 @@
     if (nIndex == -1) {
        /* EPP: this seems to be an undocumented call (from my IE4)
-	* I assume in that case that:
-	* - lpTbb->iString is a string pointer (not a string index in strings[] table
-	* - index of insertion is at the end of existing buttons
-	* I only see this happen with nIndex == -1, but it could have a special
-	* meaning (like -nIndex (or ~nIndex) to get the real position of insertion).
-	*/
-       int	len = lstrlenA((char*)lpTbb->iString) + 2;
-       LPSTR	ptr = COMCTL32_Alloc(len);
+        * I assume in that case that:
+        * - lpTbb->iString is a string pointer (not a string index in strings[] table
+        * - index of insertion is at the end of existing buttons
+        * I only see this happen with nIndex == -1, but it could have a special
+        * meaning (like -nIndex (or ~nIndex) to get the real position of insertion).
+        */
+       int      len = lstrlenA((char*)lpTbb->iString) + 2;
+       LPSTR    ptr = COMCTL32_Alloc(len);
 
        nIndex = infoPtr->nNumButtons;
@@ -3447,12 +3447,12 @@
     if (GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT)
     {
-	infoPtr->nHotItem = (INT)wParam;
-
-	/* FIXME: What else must be done ??? */
+        infoPtr->nHotItem = (INT)wParam;
+
+        /* FIXME: What else must be done ??? */
 
     }
 
     if (nOldHotItem < 0)
-	return -1;
+        return -1;
 
     return (LRESULT)nOldHotItem;
@@ -3842,16 +3842,16 @@
             return 0;
 
-	if (btnPtr->fsStyle &  TBSTYLE_DROPDOWN)
-	{
-	    NMTOOLBARA nmtb;
-
-	    nmtb.hdr.hwndFrom = hwnd;
-	    nmtb.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
-	    nmtb.hdr.code = TBN_DROPDOWN;
-	    nmtb.iItem = btnPtr->idCommand;
-
-	    SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
-			  (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
-	}
+        if (btnPtr->fsStyle &  TBSTYLE_DROPDOWN)
+        {
+            NMTOOLBARA nmtb;
+
+            nmtb.hdr.hwndFrom = hwnd;
+            nmtb.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
+            nmtb.hdr.code = TBN_DROPDOWN;
+            nmtb.iItem = btnPtr->idCommand;
+
+            SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
+                          (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
+        }
 
         SetCapture (hwnd);
@@ -3925,30 +3925,30 @@
         ReleaseDC (hwnd, hdc);
 
-	if (bSendMessage) {
-	    SendMessageA (GetParent(hwnd), WM_COMMAND,
-			  MAKEWPARAM(btnPtr->idCommand, 0), (LPARAM)hwnd);
-
-	    if ((GetWindowLongA(hwnd, GWL_STYLE) & TBSTYLE_DROPDOWN) ||
-		(btnPtr->fsStyle & 0x08/* BTNS_DROPDOWN */)) {
-	       NMTOOLBARW	nmtb;
-
-	       nmtb.hdr.hwndFrom = hwnd;
-	       nmtb.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
-	       nmtb.hdr.code     = TBN_DROPDOWN;
-	       nmtb.iItem        = nHit;
-	       /* nmtb.tbButton not used with TBN_DROPDOWN */
-	       if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings)) {
-		  nmtb.pszText      = infoPtr->strings[btnPtr->iString];
-		  nmtb.cchText      = lstrlenW(nmtb.pszText);
-	       } else {
-		  nmtb.pszText      = NULL;
-		  nmtb.cchText      = 0;
-	       }
-	       nmtb.rcButton     = btnPtr->rect;
-
-	       SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
-			    (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
-	    }
-	}
+        if (bSendMessage) {
+            SendMessageA (GetParent(hwnd), WM_COMMAND,
+                          MAKEWPARAM(btnPtr->idCommand, 0), (LPARAM)hwnd);
+
+            if ((GetWindowLongA(hwnd, GWL_STYLE) & TBSTYLE_DROPDOWN) ||
+                (btnPtr->fsStyle & 0x08/* BTNS_DROPDOWN */)) {
+               NMTOOLBARW       nmtb;
+
+               nmtb.hdr.hwndFrom = hwnd;
+               nmtb.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
+               nmtb.hdr.code     = TBN_DROPDOWN;
+               nmtb.iItem        = nHit;
+               /* nmtb.tbButton not used with TBN_DROPDOWN */
+               if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings)) {
+                  nmtb.pszText      = infoPtr->strings[btnPtr->iString];
+                  nmtb.cchText      = lstrlenW(nmtb.pszText);
+               } else {
+                  nmtb.pszText      = NULL;
+                  nmtb.cchText      = 0;
+               }
+               nmtb.rcButton     = btnPtr->rect;
+
+               SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
+                            (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
+            }
+        }
 
         infoPtr->nButtonDown = -1;
@@ -4223,10 +4223,10 @@
 
     if (nType == GWL_STYLE) {
-	if (lpStyle->styleNew & TBSTYLE_LIST) {
-	    infoPtr->dwDTFlags = DT_LEFT | DT_VCENTER | DT_SINGLELINE;
-	}
-	else {
-	    infoPtr->dwDTFlags = DT_CENTER;
-	}
+        if (lpStyle->styleNew & TBSTYLE_LIST) {
+            infoPtr->dwDTFlags = DT_LEFT | DT_VCENTER | DT_SINGLELINE;
+        }
+        else {
+            infoPtr->dwDTFlags = DT_CENTER;
+        }
     }
 
@@ -4274,6 +4274,6 @@
             return TOOLBAR_AddStringW (hwnd, wParam, lParam);
 
-	case TB_AUTOSIZE:
-	    return TOOLBAR_AutoSize (hwnd);
+        case TB_AUTOSIZE:
+            return TOOLBAR_AutoSize (hwnd);
 
         case TB_BUTTONCOUNT:
@@ -4301,6 +4301,6 @@
             return TOOLBAR_EnableButton (hwnd, wParam, lParam);
 
-	case TB_GETANCHORHIGHLIGHT:
-	    return TOOLBAR_GetAnchorHighlight (hwnd);
+        case TB_GETANCHORHIGHLIGHT:
+            return TOOLBAR_GetAnchorHighlight (hwnd);
 
         case TB_GETBITMAP:
@@ -4339,6 +4339,6 @@
             return TOOLBAR_GetHotImageList (hwnd, wParam, lParam);
 
-	case TB_GETHOTITEM:
-	    return TOOLBAR_GetHotItem (hwnd);
+        case TB_GETHOTITEM:
+            return TOOLBAR_GetHotItem (hwnd);
 
         case TB_GETIMAGELIST:
@@ -4378,6 +4378,6 @@
             return TOOLBAR_GetUnicodeFormat (hwnd, wParam, lParam);
 
-	case CCM_GETVERSION:
-	    return TOOLBAR_GetVersion (hwnd);
+        case CCM_GETVERSION:
+            return TOOLBAR_GetVersion (hwnd);
 
         case TB_HIDEBUTTON:
@@ -4435,6 +4435,6 @@
             return TOOLBAR_SaveRestoreW(hwnd,wParam,lParam);
 
-	case TB_SETANCHORHIGHLIGHT:
-	    return TOOLBAR_SetAnchorHighlight (hwnd, wParam);
+        case TB_SETANCHORHIGHLIGHT:
+            return TOOLBAR_SetAnchorHighlight (hwnd, wParam);
 
         case TB_SETBITMAPSIZE:
@@ -4470,6 +4470,6 @@
             return TOOLBAR_SetHotImageList (hwnd, wParam, lParam);
 
-	case TB_SETHOTITEM:
-	    return TOOLBAR_SetHotItem (hwnd, wParam);
+        case TB_SETHOTITEM:
+            return TOOLBAR_SetHotItem (hwnd, wParam);
 
         case TB_SETIMAGELIST:
@@ -4507,6 +4507,6 @@
             return TOOLBAR_SetUnicodeFormat (hwnd, wParam, lParam);
 
-	case CCM_SETVERSION:
-	    return TOOLBAR_SetVersion (hwnd, (INT)wParam);
+        case CCM_SETVERSION:
+            return TOOLBAR_SetVersion (hwnd, (INT)wParam);
 
 /*      case WM_CHAR: */
@@ -4518,6 +4518,6 @@
             return TOOLBAR_EraseBackground (hwnd, wParam, lParam);
 
-	case WM_GETFONT:
-		return TOOLBAR_GetFont (hwnd, wParam, lParam);
+        case WM_GETFONT:
+                return TOOLBAR_GetFont (hwnd, wParam, lParam);
 
 /*      case WM_KEYDOWN: */
@@ -4556,6 +4556,6 @@
             return TOOLBAR_Size (hwnd, wParam, lParam);
 
-	case WM_STYLECHANGED:
-	    return TOOLBAR_StyleChanged (hwnd, (INT)wParam, (LPSTYLESTRUCT)lParam);
+        case WM_STYLECHANGED:
+            return TOOLBAR_StyleChanged (hwnd, (INT)wParam, (LPSTYLESTRUCT)lParam);
 
 /*      case WM_SYSCOLORCHANGE: */
