How can I handle combobox notifications in a CGXComboBoxWnd derived class?
This can be done by overriding the OnCommand( ) method.
Example:
BOOL CMyComboBoxWnd::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) // is it really this wnd?
{
if (nNotification == CBN_SELCHANGE)
{
TRACE("Dropdown list changed\n");
}
}
return CGXComboBoxWnd::OnCommand(wParam, lParam);
}