https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3bfdbf3b2c253a0ef21303...
commit 3bfdbf3b2c253a0ef21303b8fc7aed5e67947146 Author: Giannis Adamopoulos gadamopoulos@reactos.org AuthorDate: Fri Oct 20 19:41:01 2017 +0300
[BROWSEUI] Improve CBandSiteBase::OnWinEvent to forward messages correctly to the child bands. --- dll/win32/browseui/shellbars/CBandSite.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/dll/win32/browseui/shellbars/CBandSite.cpp b/dll/win32/browseui/shellbars/CBandSite.cpp index 24ca2e9322..520f9eba58 100644 --- a/dll/win32/browseui/shellbars/CBandSite.cpp +++ b/dll/win32/browseui/shellbars/CBandSite.cpp @@ -694,12 +694,32 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
return S_OK; } - - if (hWnd == fRebarWindow) + else if (uMsg == WM_COMMAND && lParam) { - /* FIXME: Just send the message? */ - *plrResult = SendMessageW(hWnd, uMsg, wParam, lParam); - return S_OK; + hWnd = reinterpret_cast<HWND>(lParam); + } + else if (uMsg == WM_NOTIFY) + { + NMHDR* pnmhdr = reinterpret_cast<NMHDR*>(lParam); + if (pnmhdr->hwndFrom != fRebarWindow) + { + hWnd = pnmhdr->hwndFrom; + } + else + { + for (int i = 0; i < fBandsAllocated; i++) + { + if (fBands[i].WndEvtHandler && fBands[i].OleWindow) + { + HWND hwndBand; + if (SUCCEEDED(fBands[i].OleWindow->GetWindow(&hwndBand))) + { + fBands[i].WndEvtHandler->OnWinEvent(hwndBand, uMsg, wParam, lParam, plrResult); + } + } + } + return S_OK; + } }
Band = GetBandFromHwnd(hWnd);