}
MRESULT EXPENTRY fnwpNSWindow( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){#if DEBUG_sobotka  if (msg == WM_BUTTON1DOWN || msg == WM_BUTTON1DBLCLK)      printf("\n++++++++++fnwpNSWindow processing click for 0x%lx <-------CLICK\n", hwnd);#endif   // Get the nsWindow for this hwnd   nsWindow *wnd = NS_HWNDToWindow( hwnd);   // check to see if we have a rollup listener registered   if (nsnull != gRollupListener && nsnull != gRollupWidget) {      if (msg == WM_ACTIVATE || msg == WM_BUTTON1DOWN ||           msg == WM_BUTTON2DOWN || msg == WM_BUTTON3DOWN) {         // Rollup if the event is outside the popup         if (PR_FALSE == nsWindow::EventIsInsideWindow((nsWindow*)gRollupWidget)) {            gRollupListener->Rollup();            // if we are supposed to be consuming events and it is            // a Mouse Button down, let it go through            if (gRollupConsumeRollupEvent && msg != WM_BUTTON1DOWN) {//               return FALSE;            }         }       }    }   // Messages which get re-routed if their source was an nsWindow   // (it's very bad to reroute messages whose source isn't an nsWindow,   // listboxes with scrollbars for example would break)   switch( msg)   {      case WM_CONTROL:      case WM_HSCROLL:      case WM_VSCROLL: // !! potential problems here if canvas children      {         // assume parent == owner, true for our creations         HWND hwndChild = WinWindowFromID( hwnd, SHORT1FROMMP( mp1));         if( hwndChild)         {            nsWindow *w = NS_HWNDToWindow( hwndChild);            if( w)               wnd = w;         }         break;      }   }   MRESULT mRC = 0;   if( wnd)   {      BOOL bPreHandling = g_bHandlingMouseClick;      if( PR_FALSE == wnd->ProcessMessage( msg, mp1, mp2, mRC) &&          wnd->GetPrevWP())      {         mRC = (wnd->GetPrevWP())( hwnd, msg, mp1, mp2);      }      if( !bPreHandling)         g_bHandlingMouseClick = FALSE;   }   else      /* erm */ mRC = WinDefWindowProc( hwnd, msg, mp1, mp2);   return mRC;}