It is possible that the messages you are missing are being intercepted as dialog messages. In a MFC dialog, before messages are passed to the primary message loop, they are filtered through PreTranslateMessage and PreTranslateMessage calls IsDialogMessage which then handles or translates some messages outside of the normal message loop. You can control this process by using the ClassWizard to add a PreTranslateMessage implementation to your dialog class and making it something like the following:
BOOL CMyDlg::PreTranslateMessage( MSG msg )
{
// Return FALSE for messages you want to
// prevent from being processed as dialog
// messages
if (msg.message == WM_KEYDOWN && ...)
return FALSE;
else if( IsDi
alogMessage( msg ) )
return TRUE;
else
return CDialog::PreTranslateMessage( msg );
}
Let me know if this is not the problem.
Thanks,
Tony
NI - Measurement Studio