I ran into the same issue. This is a bug in MFC. (It's over 4 years later and it is still there.) Somehow ON_CBN_KILLFOCUS
handler is never called although the Win32 CBN_KILLFOCUS
notification itself is broadcast.
To fix this override the WindowProc
for the dialog manually (Win32-way):
LRESULT CMyDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
//Fix for the bug in MFC
if(message == WM_COMMAND)
{
if(HIWORD(wParam) == CBN_KILLFOCUS &&
LOWORD(wParam) == Your_ComboBox_ID)
{
OnCbnKillfocusComboBox();
}
}
return CDialog::WindowProc(message, wParam, lParam);
}