How can I handle combobox notifications in a CGXComboBox derived class?

This can also be done by overriding OnCommand( ), but you have to check for listbox notifications.

Example:

BOOL CMyComboBox::OnCommand(WPARAM wParam, LPARAM lParam)
{
#if _MFC_VER < 0x0300
   UINT nNotification = HIWORD(lParam);
   HWND hCtl = (HWND) LOWORD(lParam);
#else
   UINT nNotification = HIWORD(wParam);
   HWND hCtl = (HWND) lParam;
#endif
   if (hCtl == m_hWnd)
   {
      // Edit Control changed
   }
   else if (GetDroppedState( ))
   {
      // Listbox changed
      if (nNotification == LBN_SELCHANGE)
         TRACE("Listbox changed\n" );
      else
         TRACE("Listbox notification %d\n", nNotification );
   }
   return CGXComboBox::OnCommand(wParam, lParam);
}