Commit 60a1e20b authored by Mikołaj Zalewski's avatar Mikołaj Zalewski Committed by Alexandre Julliard

comctl32: Don't print ERRs for reflected messages.

parent f240b8f4
......@@ -962,7 +962,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
......
......@@ -2310,7 +2310,7 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",uMsg,wParam,lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
}
......
......@@ -149,6 +149,7 @@ VOID COMCTL32_RefreshSysColors(void);
void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal);
void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground);
void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm);
BOOL COMCTL32_IsReflectedMessage(UINT uMsg);
INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen);
INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen);
BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc);
......
......@@ -1572,6 +1572,50 @@ void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm)
ReleaseDC(NULL, hdc);
}
#ifndef OCM__BASE /* avoid including olectl.h */
#define OCM__BASE (WM_USER+0x1c00)
#endif
/***********************************************************************
* COMCTL32_IsReflectedMessage [internal]
*
* Some parents reflect notify messages - for some messages sent by the child,
* they send it back with the message code increased by OCM__BASE (0x2000).
* This allows better subclassing of controls. We don't need to handle such
* messages but we don't want to print ERRs for them, so this helper function
* identifies them.
*
* Some of the codes are in the CCM_FIRST..CCM_LAST range, but there is no
* colision with defined CCM_ codes.
*/
BOOL COMCTL32_IsReflectedMessage(UINT uMsg)
{
switch (uMsg)
{
case OCM__BASE + WM_COMMAND:
case OCM__BASE + WM_CTLCOLORBTN:
case OCM__BASE + WM_CTLCOLOREDIT:
case OCM__BASE + WM_CTLCOLORDLG:
case OCM__BASE + WM_CTLCOLORLISTBOX:
case OCM__BASE + WM_CTLCOLORMSGBOX:
case OCM__BASE + WM_CTLCOLORSCROLLBAR:
case OCM__BASE + WM_CTLCOLORSTATIC:
case OCM__BASE + WM_DRAWITEM:
case OCM__BASE + WM_MEASUREITEM:
case OCM__BASE + WM_DELETEITEM:
case OCM__BASE + WM_VKEYTOITEM:
case OCM__BASE + WM_CHARTOITEM:
case OCM__BASE + WM_COMPAREITEM:
case OCM__BASE + WM_HSCROLL:
case OCM__BASE + WM_VSCROLL:
case OCM__BASE + WM_PARENTNOTIFY:
case OCM__BASE + WM_NOTIFY:
return TRUE;
default:
return FALSE;
}
}
/***********************************************************************
* MirrorIcon [COMCTL32.414]
*
......
......@@ -1381,7 +1381,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return (LRESULT) infoPtr->hFont;
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
......
......@@ -257,7 +257,7 @@ FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return FlatSB_Destroy (hwnd, wParam, lParam);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
......
......@@ -2125,7 +2125,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return HEADER_SetRedraw(hwnd, wParam, lParam);
default:
if ((msg >= WM_USER) && (msg < WM_APP))
if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
ERR("unknown msg %04x wp=%04lx lp=%08lx\n",
msg, wParam, lParam );
return DefWindowProcW(hwnd, msg, wParam, lParam);
......
......@@ -528,7 +528,7 @@ HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return HOTKEY_SetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
......
......@@ -590,7 +590,7 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return IPADDRESS_IsBlank (infoPtr);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
}
......
......@@ -10033,7 +10033,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case WM_WININICHANGE: */
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
fwd_msg:
......
......@@ -2072,7 +2072,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return MONTHCAL_Destroy(infoPtr);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR( "unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
......
......@@ -101,7 +101,7 @@ NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
......
......@@ -722,7 +722,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
return infoPtr->Marquee;
default:
if ((message >= WM_USER) && (message < WM_APP))
if ((message >= WM_USER) && (message < WM_APP) && !COMCTL32_IsReflectedMessage(message))
ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam );
return DefWindowProcW( hwnd, message, wParam, lParam );
}
......
......@@ -3733,7 +3733,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return REBAR_WindowPosChanged (infoPtr, wParam, lParam);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
......
......@@ -1346,7 +1346,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return theme_changed (infoPtr);
default:
if ((msg >= WM_USER) && (msg < WM_APP))
if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
ERR("unknown msg %04x wp=%04lx lp=%08lx\n",
msg, wParam, lParam);
return DefWindowProcW (hwnd, msg, wParam, lParam);
......
......@@ -1750,7 +1750,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
default:
HandleDefaultMessage:
if ((message >= WM_USER) && (message < WM_APP))
if ((message >= WM_USER) && (message < WM_APP) && !COMCTL32_IsReflectedMessage(message))
{
ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam );
}
......
......@@ -3269,7 +3269,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TAB_NCCalcSize(hwnd, wParam, lParam);
default:
if (uMsg >= WM_USER && uMsg < WM_APP)
if (uMsg >= WM_USER && uMsg < WM_APP && !COMCTL32_IsReflectedMessage(uMsg))
WARN("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam);
break;
......
......@@ -7046,7 +7046,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
......
......@@ -2843,7 +2843,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLTIPS_WinIniChange (hwnd, wParam, lParam);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
......
......@@ -1911,7 +1911,7 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRACKBAR_InitializeThumb (infoPtr);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
}
......
......@@ -5705,7 +5705,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
default:
/* This mostly catches MFC and Delphi messages. :( */
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
TRACE("Unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
def:
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
......
......@@ -1082,7 +1082,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
return temp;
default:
if ((message >= WM_USER) && (message < WM_APP))
if ((message >= WM_USER) && (message < WM_APP) && !COMCTL32_IsReflectedMessage(message))
ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam);
return DefWindowProcW (hwnd, message, wParam, lParam);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment