Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Catching WM_KILLFOCUS

332 views
Skip to first unread message

Bostjan Erzen

unread,
Mar 2, 2002, 6:58:29 AM3/2/02
to
Hi!

I have dialog with various control placed in designed time
and edit box created in runtime. What I want to know is
when runtime created editbox loses focus. I tried several
ways, from catching WM_KILLFOCUS to WM_COMMAND (with
EN_KILLFOCUS notification) but nothing worked. All this
was done in CMyDialog::PreTranslateMessage() and not even
one message with WM_KILLFOCUS ended in this method. Why is
that and isn't this method the first(lowest) possible
method for filtering messages in MFC? So if this is the
first one, all messages should first end up here,
including WM_KILLFOCUS.

CMyDialog::OnKillfocusEdit1() works fine for design time
controls.

Ultimatelly I want to know when editbox loses focus.
Parent of that editbox is not CMyDialog, but CListCtrl on
CMyDialog.

Thanks,

Bostjan

Scot T Brennecke

unread,
Mar 2, 2002, 10:05:25 AM3/2/02
to
Bostjan,
The WM_KILLFOCUS is sent directly to the edit control, which then sends
EN_KILLFOCUS (in a WM_COMMAND) to its parent, the CListCtrl. The dialog is not
involved in this at all, so of course, it won't receive either of those
messages. Either handle WM_KILLFOCUS in your edit class, or EN_KILLFOCUS in
your listview control.
0 new messages