comctl32/toolbar: Forward WM_NOTIFY CBEN_ENDEDITW.

This makes 7-Zip File Manager press enter in path input work.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57178
This commit is contained in:
Alanas 2024-11-18 13:34:57 +00:00
parent b76b4c9a27
commit 529757ef1b
2 changed files with 20 additions and 2 deletions

View file

@ -2875,8 +2875,8 @@ static void test_WM_NOTIFY(void)
rebuild_toolbar(&toolbar);
test_WM_NOTIFY_expect_CBEN_ENDEDITA = TRUE;
ret = SendMessageA(toolbar, WM_NOTIFY, 0, (LPARAM)&test_WM_NOTIFY_NMCBEENDEDITW);
todo_wine ok(ret == 0xabcd0006, "SendMessageA returned 0x%Ix.\n", ret);
todo_wine ok(!test_WM_NOTIFY_expect_CBEN_ENDEDITA, "Toolbar didn't convert and forward WM_NOTIFY to parent.\n");
ok(ret == 0xabcd0006, "SendMessageA returned 0x%Ix.\n", ret);
ok(!test_WM_NOTIFY_expect_CBEN_ENDEDITA, "Toolbar didn't convert and forward WM_NOTIFY to parent.\n");
test_WM_NOTIFY_expect_CBEN_ENDEDITA = FALSE;
DestroyWindow(toolbar);
}

View file

@ -6359,6 +6359,24 @@ TOOLBAR_Notify (TOOLBAR_INFO *infoPtr, LPNMHDR lpnmh)
FIXME("TTN_GETDISPINFOA - should not be received; please report\n");
return 0;
/* FIXME: CBEN_ENDEDITW is just 1 of 4294967244 codes that should be forwarded */
case CBEN_ENDEDITW:
if (!infoPtr->bUnicode)
{
NMCBEENDEDITW *nmedW = (NMCBEENDEDITW *)lpnmh;
NMCBEENDEDITA nmedA = {{0}};
nmedA.hdr.code = CBEN_ENDEDITA;
nmedA.hdr.hwndFrom = nmedW->hdr.hwndFrom;
nmedA.hdr.idFrom = nmedW->hdr.idFrom;
nmedA.fChanged = nmedW->fChanged;
nmedA.iNewSelection = nmedW->iNewSelection;
nmedA.iWhy = nmedW->iWhy;
WideCharToMultiByte(CP_ACP, 0, nmedW->szText, ARRAY_SIZE(nmedW->szText), nmedA.szText, ARRAY_SIZE(nmedA.szText),
NULL, FALSE);
return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, lpnmh->idFrom, (LPARAM)&nmedA);
}
return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, lpnmh->idFrom, (LPARAM)lpnmh);
default:
return 0;
}