Re: Controls - Not receiving key messages ON_WM_KEYDOWN
If you click on the control (thus causing a WM_KEYDOWN message, the =
should get the focus at that point if it is not disabled.
It doesn't work like that.
See this Subclassed Edit Control. Look for PopupEdit::Show()
You can see that it uses SetFocus() to get keyboard messsages.
( I always thought SetFocus had to do with something else, but that is =
actually what reroutes keyboad messages.)
I know I have to call SetFocus() inside my control somewhere.
I just don't know where right now. I tried it in OnShowWindow()...
It doesn't complain or break, the program just shuts down with a ton of =
So, I am thinking that must not be the place.
It works if I put it in OnMouseMove(), or OnLButtonDown(), but that is =
not the right place for it.
So, I almost got it!
What I am thinking about, which I don't quite understand just yet, is =
when OnInitDialog() or OnInitalUpdate() is called.
It must be happening after the parent window is shown, but prior to =
child window being displayed.
There is no OnInitDialog() or OnInitialUpdate() in CWnd, so I am on my =
own in developing something similar.
"Tom Serface" <firstname.lastname@example.org> wrote in message =
"Nobody" <Nobody@yahoo.com> wrote in message
I think it has something to do with SetFocus(). I guess that reroutes
I have an overriden OnSetFocus() in my view, so I added the SetFocus() =
void CMyView::OnSetFocus(CWnd* pOldWnd)
But, it is not the kind of functionality that I want.
The user does not have to do that to a Scrollbar or edit control.
The keyboard just automatically works.
That is what I am trying to do.
I don't have a OnInitialize, or OnInitDlg in my Control.
I don't know exactly how that works.
It is called after the parent window is shown, but prior to the child =
I tried adding SetFocus to the WM_SHOWWINDOW method, but that fails =