comctl32/ipaddress: Only print an error when it actually occurs.

IPADDRESS_GetPartIndex() is also used for handling WM_KILLFOCUS
and WM_SETFOCUS messages. In this case, it's actually expected that the
window receiving or losing focus may not be a IP Address part window.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-02-22 22:50:40 +08:00 committed by Alexandre Julliard
parent a11ffeec96
commit 7315afbc13
1 changed files with 5 additions and 2 deletions

View File

@ -130,7 +130,6 @@ static int IPADDRESS_GetPartIndex(const IPADDRESS_INFO *infoPtr, HWND hwnd)
for (i = 0; i < 4; i++)
if (infoPtr->Part[i].EditHwnd == hwnd) return i;
ERR("We subclassed the wrong window! (hwnd=%p)\n", hwnd);
return -1;
}
@ -503,7 +502,11 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
TRACE("(hwnd=%p msg=0x%x wparam=0x%lx lparam=0x%lx)\n", hwnd, uMsg, wParam, lParam);
if ( (index = IPADDRESS_GetPartIndex(infoPtr, hwnd)) < 0) return 0;
if ((index = IPADDRESS_GetPartIndex(infoPtr, hwnd)) < 0)
{
ERR("We subclassed the wrong window! (hwnd=%p)\n", hwnd);
return 0;
}
part = &infoPtr->Part[index];
if (uMsg == WM_CHAR || uMsg == WM_KEYDOWN) {