Sync to trunk head (r47736)
[reactos.git] / dll / win32 / comctl32 / status.c
index d6b627a..1b69ef2 100644 (file)
@@ -233,7 +233,7 @@ STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART
        dis.hDC = hdc;
        dis.rcItem = r;
        dis.itemData = (ULONG_PTR)part->text;
-       SendMessageW (infoPtr->Notify, WM_DRAWITEM, (WPARAM)dis.CtlID, (LPARAM)&dis);
+       SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
     } else {
        if (part->hIcon) {
           INT cy = r.bottom - r.top;
@@ -728,7 +728,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
 
 static BOOL
 STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
-                   LPCWSTR text, BOOL isW)
+                   LPWSTR text, BOOL isW)
 {
     STATUSWINDOWPART *part=NULL;
     BOOL changed = FALSE;
@@ -759,7 +759,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
     if (style & SBT_OWNERDRAW) {
         if (!(oldStyle & SBT_OWNERDRAW))
             Free (part->text);
-        part->text = (LPWSTR)text;
+        part->text = text;
     } else {
        LPWSTR ntext;
        WCHAR  *idx;
@@ -1162,7 +1162,7 @@ STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
 
 
 static LRESULT
-STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, LPARAM lParam)
+STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, UINT msg, WPARAM wParam, LPARAM lParam)
 {
     NMMOUSE  nm;
 
@@ -1175,7 +1175,12 @@ STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, LPARAM lParam)
     nm.dwItemSpec = STATUSBAR_InternalHitTest(infoPtr, &nm.pt);
     nm.dwItemData = 0;
     nm.dwHitInfo = 0x30000;     /* seems constant */
-    SendMessageW(infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nm);
+
+    /* Do default processing if WM_NOTIFY returns zero */
+    if(!SendMessageW(infoPtr->Notify, WM_NOTIFY, nm.hdr.idFrom, (LPARAM)&nm))
+    {
+      return DefWindowProcW(infoPtr->Self, msg, wParam, lParam);
+    }
     return 0;
 }
 
@@ -1243,10 +1248,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
            return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam);
 
        case SB_SETTEXTA:
-           return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPCWSTR)lParam, FALSE);
+           return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, FALSE);
 
        case SB_SETTEXTW:
-           return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPCWSTR)lParam, TRUE);
+           return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, TRUE);
 
        case SB_SETTIPTEXTA:
            return STATUSBAR_SetTipTextA (infoPtr, (INT)wParam, (LPSTR)lParam);
@@ -1276,10 +1281,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
            return STATUSBAR_GetTextLength (infoPtr, 0);
 
        case WM_LBUTTONDBLCLK:
-            return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, lParam);
+            return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, msg, wParam, lParam);
 
        case WM_LBUTTONUP:
-           return STATUSBAR_SendMouseNotify(infoPtr, NM_CLICK, lParam);
+           return STATUSBAR_SendMouseNotify(infoPtr, NM_CLICK, msg, wParam, lParam);
 
        case WM_MOUSEMOVE:
            return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
@@ -1303,10 +1308,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
            return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
 
        case WM_RBUTTONDBLCLK:
-           return STATUSBAR_SendMouseNotify(infoPtr, NM_RDBLCLK, lParam);
+           return STATUSBAR_SendMouseNotify(infoPtr, NM_RDBLCLK, msg, wParam, lParam);
 
        case WM_RBUTTONUP:
-           return STATUSBAR_SendMouseNotify(infoPtr, NM_RCLICK, lParam);
+           return STATUSBAR_SendMouseNotify(infoPtr, NM_RCLICK, msg, wParam, lParam);
 
        case WM_SETFONT:
            return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));