From 2ac238458dc3d0d1bf915a0e6bf0403c0edc8b5b Mon Sep 17 00:00:00 2001 From: "pollmann%netscape.com" Date: Fri, 28 May 1999 02:11:55 +0000 Subject: [PATCH] Bug 3322: Windows sends NS_CONTROL_CHANGE events git-svn-id: svn://10.0.0.236/trunk@33084 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/windows/nsWindow.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index 1b58f5ae473..81a992d4241 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -469,6 +469,13 @@ LRESULT CALLBACK nsWindow::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM someWindow = (nsWindow*)::GetWindowLong(pnmh->hwndFrom, GWL_USERDATA); } } + // Do the same for combo box change notifications. + else if (msg == WM_COMMAND) { + WORD wNotifyCode = HIWORD(wParam); // notification code + if ((CBN_SELENDOK == wNotifyCode) || (CBN_SELENDCANCEL == wNotifyCode)) { + someWindow = (nsWindow*)::GetWindowLong((HWND) lParam, GWL_USERDATA); + } + } if (nsnull != someWindow) { @@ -2122,7 +2129,14 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT case WM_COMMAND: { WORD wNotifyCode = HIWORD(wParam); // notification code - if (wNotifyCode == 0) { // Menu selection + if ((CBN_SELENDOK == wNotifyCode) || (CBN_SELENDCANCEL == wNotifyCode)) { // Combo box change + nsGUIEvent event; + event.eventStructType = NS_GUI_EVENT; + nsPoint point(0,0); + InitEvent(event, NS_CONTROL_CHANGE, &point); // this add ref's event.widget + result = DispatchWindowEvent(&event); + NS_RELEASE(event.widget); + } else if (wNotifyCode == 0) { // Menu selection nsMenuEvent event; event.mCommand = LOWORD(wParam); event.eventStructType = NS_MENU_EVENT;