
Curious CFormView behavior
I ran into behavior that I consider unexpected when building an SDI
application using CFormView as the base class for the view (
Visual C++ 6.0).
My CFormView derivative contains four controls (two edit boxes and two
buttons). At the start of the application all controls are disabled,
because even in the case of a File | New I need to go through some user
dialog before enabling them. Now the odd thing is that the Alt key
combinations don't select items from the menu as long as the controls are
disabled. However, the F10 key works. I would expect the WM_SYSCHAR
messages to be directed to the frame window, and hence the menu, when there
are no controls in the dialog to take the keyboard focus. But apparently
that isn't happening.
I turned on Spy++ to see if I could spot where the messages were going.
Apparently they are being directed to the dialog window encapsulated in the
CFormView. Since the messages aren't redirected to any other window, I
assume the dialog is getting the WM_SYSCHAR messages and eating them. The
funny thing is that it apparently processes F10 properly, so it's only half
"wrong."
Anybody else seen this? Is this considered an MFC bug? Any good ideas for
a workaround?
Thanks!
Bill