title: OnMouseWheel not called in dialog-box
body: <p>In have a dialog-box (<code>CDialog</code>).</p>
  
  <p>All mouse events trigger their corresponding handlers, i.e.:</p>
  
  <ul>
  <li>Mouse-Left-Button-Down  events trigger the <code>OnLButtonDown</code> handler</li>
  <li>Mouse-Right-Button-Down events trigger the <code>OnRButtonDown</code> handler</li>
  <li>Mouse-Left-Button-Up    events trigger the <code>OnLButtonUp</code>   handler</li>
  <li>Mouse-Right-Button-Up   events trigger the <code>OnRButtonUp</code>   handler</li>
  <li>Mouse-Move              events trigger the <code>OnMouseMove</code>   handler</li>
  </ul>
  
  <p>All, but Mouse-wheel events, which do not trigger the <code>OnMouseWheel</code> handler for some reason.</p>
  
  <p>WOE??? (as in 'What On Earth', which is a mild way of expressing my thoughts on MFC at the moment).</p>
  
  <p>Instead, I need to handle these events in the <code>PreTranslateMessage</code> handler.</p>
  
  <p>Of course I can use this as a solution, but for coding reason I would highly prefer to handle them in the same manner that I handle all other mouse events.</p>
  
  <p>Any idea what could be the problem here?</p>
  
  <p>Most of the answers that I've found suggest adding <code>ON_WM_MOUSEHWHEEL</code> to the message-map, but I'm already doing this of course (as I do for all other mouse events).</p>
  
  <p>I found one answer suggesting to add <code>WS_TABSTOP</code> to the dialog-box style. Couldn't possibly see the logical sense in that, but tried it anyhow (without any success, as expected).</p>
  
  <p>Thank you.</p>
  
  <h2>MY CODE:</h2>
  
  <p><strong>Header File:</strong></p>
  
  <pre><code>class CInputDlg : public CDialog
  {
  public:
      CInputDlg(CWnd* pParent = NULL);
      virtual ~CInputDlg();
  
  DECLARE_MESSAGE_MAP();
  
  protected:
      afx_msg void OnLButtonDown(UINT flags,CPoint point);
      afx_msg void OnMouseWheel(UINT flags,short delta,CPoint point);
  };
  </code></pre>
  
  <p><strong>Source File:</strong></p>
  
  <pre><code>BEGIN_MESSAGE_MAP(CInputDlg,CDialog)
      ON_WM_LBUTTONDOWN()
      ON_WM_MOUSEHWHEEL()
  END_MESSAGE_MAP()
  
  CInputDlg::CInputDlg(CWnd* pParent):CDialog(IDD_DIALOG,pParent)
  {
  }
  
  CInputDlg::~CInputDlg()
  {
  }
  
  void CInputDlg::OnLButtonDown(UINT flags,CPoint point)
  {
      // This function is reached when I click the mouse-left-button
  }
  
  void CInputDlg::OnMouseWheel(UINT flags,short delta,CPoint point)
  {
      // This function is not reached when I roll the mouse-wheel
  }
  </code></pre>
  
  <p><strong>Resource File:</strong></p>
  
  <pre><code>IDD_DIALOG DIALOGEX 0, 0, 400, 200
  STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX |
  WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
  EXSTYLE WS_EX_APPWINDOW
  BEGIN
  END
  </code></pre>