title: Handling both mouse move and mouse click on a tray icon
body: <p>My VB6 application is usually hidden and has a tray icon. It currently handles a user-defined callback as per this code:</p>
  
  <pre><code>Public Const WM_USER = &amp;H400
  Public Const TRAY_CALLBACK = (WM_USER + 1001&amp;)
  With GTStruct
      .uID = mId
      .hwnd = frm.hwnd
      .hIcon = frm.Icon.Handle
      .UFlags = NIF_ICON Or NIF_MESSAGE
      .uCallbackMessage = TRAY_CALLBACK        
      .cbSize = Len(GTStruct)
  End With
  Shell_NotifyIcon NIM_ADD, GTStruct
  </code></pre>
  
  <p>A WindowProc handles TRAY_CALLBACK and the click message:</p>
  
  <pre><code>Const WM_NCDESTROY = &amp;H82
  Const WM_CLOSE = &amp;H10
  
  ' If we're being destroyed, remove the tray icon
  ' and restore the original WindowProc.
  If Msg = WM_NCDESTROY Or Msg = WM_CLOSE Then
      RemoveFromTray
  ElseIf Msg = TRAY_CALLBACK Then
      ' The user clicked on the tray icon.
      ' Look for click events.
      If lParam = WM_RBUTTONUP Then
          ' On right click, show the menu.
          SetForegroundWindow TheForm.hwnd
          TheForm.PopupMenu TheMenu
          If Not (TheForm Is Nothing) Then
              PostMessage TheForm.hwnd, WM_NULL, ByVal 0&amp;, ByVal 0&amp;
          End If
          Exit Function
      End If
  End If
  </code></pre>
  
  <p>As it is, the application works and right-clickign the icon brings up the menu. I want to handle the mouse_move message in addition to this existing callback message so I changed the callback to this:</p>
  
  <pre><code>.uCallbackMessage = TRAY_CALLBACK Or WM_MOUSEMOVE 
  </code></pre>
  
  <p>However, this ignores the mousemove message. If I use :</p>
  
  <pre><code>.uCallbackMessage = WM_MOUSEMOVE 
  </code></pre>
  
  <p>The mouse_move message works and Form_MouseMove is called properly but then the menu stops working.</p>
  
  <p><strong>The question</strong></p>
  
  <p>How can I specify multiple callbacks in order to handle both the mouse move and the mouse click?</p>