From: Alanas alanas.00@mail.ru
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57178 --- dlls/comctl32/tests/toolbar.c | 8 ++++---- dlls/comctl32/toolbar.c | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index b780cc401f3..ddd8c5d1f40 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -2887,8 +2887,8 @@ static void test_WM_NOTIFY(void) test_WM_NOTIFY_nmhdr = &nm; ret = SendMessageA(toolbar, WM_NOTIFY, 0, (LPARAM)&nm); } - todo_wine ok(ret == TEST_WM_NOTIFY_RETURN, "SendMessageA returned 0x%Ix.\n", ret); - todo_wine ok(test_WM_NOTIFY_state == TEST_WM_NOTIFY_SIMPLE_FORWARD_DONE, "Toolbar didn't forward WM_NOTIFY to parent.\n"); + ok(ret == TEST_WM_NOTIFY_RETURN, "SendMessageA returned 0x%Ix.\n", ret); + ok(test_WM_NOTIFY_state == TEST_WM_NOTIFY_SIMPLE_FORWARD_DONE, "Toolbar didn't forward WM_NOTIFY to parent.\n");
test_WM_NOTIFY_state = TEST_WM_NOTIFY_CONVERT_FORWARD; { @@ -2905,8 +2905,8 @@ static void test_WM_NOTIFY(void) test_WM_NOTIFY_nmhdr = &nm.nmhdr; ret = SendMessageA(toolbar, WM_NOTIFY, 0, (LPARAM)&nm); } - todo_wine ok(ret == TEST_WM_NOTIFY_RETURN, "SendMessageA returned 0x%Ix.\n", ret); - todo_wine ok(test_WM_NOTIFY_state == TEST_WM_NOTIFY_CONVERT_FORWARD_DONE, "Toolbar didn't forward WM_NOTIFY to parent.\n"); + ok(ret == TEST_WM_NOTIFY_RETURN, "SendMessageA returned 0x%Ix.\n", ret); + ok(test_WM_NOTIFY_state == TEST_WM_NOTIFY_CONVERT_FORWARD_DONE, "Toolbar didn't forward WM_NOTIFY to parent.\n");
test_WM_NOTIFY_state = TEST_WM_NOTIFY_NO_FORWARD; { diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 690a02db6ee..1e198895698 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -172,6 +172,7 @@ typedef struct TBUTTON_INFO *buttons; /* pointer to button array */ LPWSTR *strings; /* pointer to string array */ TBITMAP_INFO *bitmaps; + COMCTL32_UnicodeBuffer unicodeBuffer;/* used in WN_NOTIFY forwarding if bUnicode */ } TOOLBAR_INFO, *PTOOLBAR_INFO;
@@ -5348,6 +5349,7 @@ TOOLBAR_Destroy (TOOLBAR_INFO *infoPtr) DeleteObject (infoPtr->hDefaultFont);
CloseThemeData (infoPtr->hTheme); + Free (infoPtr->unicodeBuffer.address);
/* free toolbar info data */ SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); @@ -6357,11 +6359,18 @@ TOOLBAR_Notify (TOOLBAR_INFO *infoPtr, LPNMHDR lpnmh)
case TTN_GETDISPINFOA: FIXME("TTN_GETDISPINFOA - should not be received; please report\n"); + break; + } + /* note: PGN_LAST < PGN_FIRST */ + if (lpnmh->code >= PGN_LAST && lpnmh->code <= PGN_FIRST) return 0; - - default: - return 0; + if (infoPtr->bUnicode) + { + TRACE("forwarding 0x%x without unicode -> ansi conversion\n", lpnmh->code); + return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, lpnmh->idFrom, (LPARAM)lpnmh); } + TRACE("forwarding 0x%x with unicode -> ansi conversion\n", lpnmh->code); + return COMCTL32_ForwardNotifyToAnsiWindow(infoPtr->hwndNotify, lpnmh, &infoPtr->unicodeBuffer); }