#no WM_KEYDOWN msgs
Hello,
I am having difficulty handling WM_KEYDOWN in CMyWindow, my CWnd-derived
window. This particular CMyWindow is the child of an MDI client window (a
CFormView window). I don't really want it to process keyboard input, and I
tried to avoid doing so by handling WM_SETFOCUS in this window by calling
SetFocus() for 1) the parent CFormView, 2) the MDI frame (CMDIChild-derived
class), and 3) the main frame (CFrameWnd-derived class) (only one at a time, of
course.) In all three cases, doing so caused all of Windows to fail to respond
to either the mouse or the keyboard (except good ol' Ctrl-Alt-Del).
OK, I can't refuse the focus–I'll handle keystrokes. So I used ClassWiz
to put in OnKeyDown and OnSysKeyDown message handlers in CMyWindow–but they
never get called. I use Spy and verify that the WM_KEYDOWN message is being
sent to my CMyWindow, but I don't get a break at the breakpoint I set in the
handlers above, nor does any debug trace output get printed–these handlers
just ain't getting called.
So what's a boy to do? Anybody got any clues as to either of the above?
Thanks for any help,
Phil C.