I derived MyComboBx from CComboBox and added a message map entry to catch a WM_CHAR, the resulting function never gets called . . . (?) Appreciate any input from you experts. Thanks! JD
Printable View
I derived MyComboBx from CComboBox and added a message map entry to catch a WM_CHAR, the resulting function never gets called . . . (?) Appreciate any input from you experts. Thanks! JD
Create a variable for tracking when the combo box has focus. Let's call it m_bFocus.
Map messages for CBN_SETFOCUS and CBN_KILLFOCUS. In the SetFocus handler, set m_bFocus to true; in the KillFocus handler, set m_bFocus to false.
Map PreTranslateMessage and in that function, place code like the following:
if(pMsg->message == WM_CHAR && m_bFocus)
{
// do soemthing now that you have the char
}
eom